Unicode variable names: Difference between revisions

no edit summary
No edit summary
Line 142:
: Δ
-> 2</lang>
 
=={{header|PHP}}==
PHP is not made to support Unicode. UTF-16 (UCS-2) will not work because it adds null bytes before or after ASCII characters (depending on endianness of UTF-16). As every code has to start with <code>&lt;?php</code> (ASCII) exactly, the parser doesn't find the match and just prints <code>&lt;?php</code> mark.
 
UTF-8 uses ASCII values for bytes which can be represented as ASCII and as result it's possible to insert <code>&lt;?php</code> mark at beginning. PHP sees your document as some 8-bit encoding (like ISO-8859-1), but it doesn't matter because UTF-8 doesn't use ASCII ranges for its values and calls to the variable are consistent.
 
<lang php><?php
$Δ = 1;
++$Δ;
echo $Δ;</lang>
 
=={{header|Protium}}==
Anonymous user