1--TEST-- 2str_increment(): Incrementing various strings 3--FILE-- 4<?php 5 6$strictlyAlphaNumeric = [ 7 "Az", 8 "aZ", 9 "A9", 10 "a9", 11 // Carrying values until the beginning of the string 12 "Zz", 13 "zZ", 14 "9z", 15 "9Z", 16 // string interpretable as a number in scientific notation 17 "5e6", 18 // Interned strings 19 "d", 20 "D", 21 "4", 22]; 23 24foreach ($strictlyAlphaNumeric as $s) { 25 var_dump(str_increment($s)); 26 var_dump($s); 27} 28 29?> 30--EXPECT-- 31string(2) "Ba" 32string(2) "Az" 33string(2) "bA" 34string(2) "aZ" 35string(2) "B0" 36string(2) "A9" 37string(2) "b0" 38string(2) "a9" 39string(3) "AAa" 40string(2) "Zz" 41string(3) "aaA" 42string(2) "zZ" 43string(3) "10a" 44string(2) "9z" 45string(3) "10A" 46string(2) "9Z" 47string(3) "5e7" 48string(3) "5e6" 49string(1) "e" 50string(1) "d" 51string(1) "E" 52string(1) "D" 53string(1) "5" 54string(1) "4" 55