Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions language/variables.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,22 @@

<note>
<simpara>
PHP doesn't support Unicode variable names, however, some character
encodings (such as UTF-8) encode characters in such a way that all bytes
of a multi-byte character fall within the allowed range, thus making it a
valid variable name.
Variable names are compared as bytes, not as characters. PHP does not
interpret or validate the encoding of the bytes from 128 through 255, and
two names refer to the same variable only when their bytes are identical.
</simpara>
<simpara>
One consequence is that names written in UTF-8 work, because every byte of
a UTF-8 multi-byte sequence falls inside the accepted range. The same holds
for any encoding whose non-ASCII bytes all fall in that range, and for byte
sequences that are not valid text in any encoding. Encodings that use bytes
below 128 within a multi-byte sequence, such as Shift-JIS or UTF-16, do not.
</simpara>
<simpara>
Another is that two names which display identically may be distinct.
<literal>ä</literal> encoded as U+00E4 and as <literal>a</literal>
followed by the combining diaeresis U+0308 are different variables, as are
a name with and without a trailing U+00A0 NO-BREAK SPACE.
</simpara>
</note>

Expand Down