PHP Reference: PHP follows Perl conventions when working with arithmetic operations on character variables, not C. For example, in PHP and Perl it $a = 'Z'; $a++;turns $ a into 'AA', and in C it a = 'Z'; a++;turns into '[' (ASCII value "Z" is 90, the ASCII value "[" is 91).
If PHP converts characters to ascii values (provided) when working with arithmetic operations on characters, should it not print '[' instead of AA? Why and how does PHP increment characters the way they do?
source
share