From 557d9ad881f369384caa0266abde410a91b50e36 Mon Sep 17 00:00:00 2001 From: Nikola Smolenski Date: Sun, 24 Apr 2011 09:38:02 +0000 Subject: [PATCH] This sentence was highly misleading, since 'Z' + 1 doesn't actually return 'AA'. Changing a few more bits around it for sake of clarity. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@310451 c90b9560-bf6c-de11-be94-00142212c4b1 --- language/operators.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/language/operators.xml b/language/operators.xml index 8082fca5b0..84fd972664 100644 --- a/language/operators.xml +++ b/language/operators.xml @@ -1569,10 +1569,10 @@ echo "Should be 4: " . $a . "
\n"; 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 ). + on character variables and not C's. For example, in PHP and Perl + $a = 'Z'; $a++; turns $a into 'AA', while in C + a = 'Z'; a++; turns a into '[' + (ASCII value of 'Z' is 90, ASCII value of '[' is 91). Note that character variables can be incremented but not decremented and even so only plain ASCII characters (a-z and A-Z) are supported.