1--TEST-- 2Test ++N operator : various numbers as strings 3--FILE-- 4<?php 5 6$strVals = array( 7 "0","65","-44", "1.2", "-7.7", 8 "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a", "a5.9", 9 "z", "az", "zz", "Z", "AZ", "ZZ", "9z", "19z", "99z", 10); 11 12 13foreach ($strVals as $strVal) { 14 echo "--- testing: '$strVal' ---\n"; 15 var_dump(++$strVal); 16} 17 18?> 19--EXPECTF-- 20--- testing: '0' --- 21int(1) 22--- testing: '65' --- 23int(66) 24--- testing: '-44' --- 25int(-43) 26--- testing: '1.2' --- 27float(2.2) 28--- testing: '-7.7' --- 29float(-6.7) 30--- testing: 'abc' --- 31string(3) "abd" 32--- testing: '123abc' --- 33string(6) "123abd" 34--- testing: '123e5' --- 35float(12300001) 36--- testing: '123e5xyz' --- 37string(8) "123e5xza" 38--- testing: ' 123abc' --- 39 40Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d 41string(7) " 123abd" 42--- testing: '123 abc' --- 43 44Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d 45string(7) "123 abd" 46--- testing: '123abc ' --- 47 48Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d 49string(7) "123abc " 50--- testing: '3.4a' --- 51 52Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d 53string(4) "3.4b" 54--- testing: 'a5.9' --- 55 56Deprecated: Increment on non-alphanumeric string is deprecated in %s on line %d 57string(4) "a5.0" 58--- testing: 'z' --- 59string(2) "aa" 60--- testing: 'az' --- 61string(2) "ba" 62--- testing: 'zz' --- 63string(3) "aaa" 64--- testing: 'Z' --- 65string(2) "AA" 66--- testing: 'AZ' --- 67string(2) "BA" 68--- testing: 'ZZ' --- 69string(3) "AAA" 70--- testing: '9z' --- 71string(3) "10a" 72--- testing: '19z' --- 73string(3) "20a" 74--- testing: '99z' --- 75string(4) "100a" 76