pollita Sat Nov 30 11:21:11 2002 EDT
Modified files:
/phpdoc/en/language variables.xml
Log:
Documentation Bug #2965
"Why is ('Z'+1) < 'Z'?"
Index: phpdoc/en/language/variables.xml
diff -u phpdoc/en/language/variables.xml:1.55 phpdoc/en/language/variables.xml:1.56
--- phpdoc/en/language/variables.xml:1.55 Sun Nov 10 17:17:10 2002
+++ phpdoc/en/language/variables.xml Sat Nov 30 11:21:10 2002
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.55 $ -->
+<!-- $Revision: 1.56 $ -->
<chapter id="language.variables">
<title>Variables</title>
@@ -109,7 +109,35 @@
</programlisting>
</informalexample>
</para>
+ <para>
+ PHP follows Perl's convention when dealing with arithmetic operations
+ on character variables and not C's. For example, in Perl 'Z'+1 turns
+ into 'AA', while in C 'Z'+1 turns into '[' { ord('Z') == 90, ord('[') == 91 ).
+ <example>
+ <title>Arithmetric Operations on Character Variables</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$i = 'W';
+for($n=0; $n<6; $n++)
+ echo ++$i . "\n";
+
+/*
+ Produces the output similar to the following:
+
+X
+Y
+Z
+AA
+AB
+AC
+*/
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
</sect1>
<sect1 id="language.variables.predefined">
--
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php