$var = 'test_1'; var_dump(++$var); // string(6) "test_2" $var2 = '1_test'; var_dump(++$var2); // string(6) "1_tesu" $var3 = 'test_z'; var_dump(++$var3); // string(6) "test_a" $var4 = 'test_'; var_dump(++$var4); // string(5) "test_"
Thus, apparently, the use of the increment operator in a string leads to an increase in the number if the last character is a number, increasing the letter, and then resetting z once if the last character is in the alphabet and has no effect on non-aviation numeric characters.
Is this the standard feature expected in many scripting languages, or did I just find a PHP Easter egg?
source share