1--TEST-- 2str_decrement(): Decrementing 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 (no underflow) 12 "Za", 13 "zA", 14 "Z0", 15 "z0", 16 // Underflow, removing leading character 17 "Aa", 18 "aA", 19 "A0", 20 "a0", 21 "10", 22 "1A", 23 "1a", 24 "10a", 25 // string interpretable as a number in scientific notation 26 "5e6", 27 // Interned strings 28 "d", 29 "D", 30 "4", 31 "1", 32]; 33 34foreach ($strictlyAlphaNumeric as $s) { 35 var_dump(str_decrement($s)); 36 var_dump($s); 37} 38 39?> 40--EXPECT-- 41string(2) "Ay" 42string(2) "Az" 43string(2) "aY" 44string(2) "aZ" 45string(2) "A8" 46string(2) "A9" 47string(2) "a8" 48string(2) "a9" 49string(2) "Yz" 50string(2) "Za" 51string(2) "yZ" 52string(2) "zA" 53string(2) "Y9" 54string(2) "Z0" 55string(2) "y9" 56string(2) "z0" 57string(1) "z" 58string(2) "Aa" 59string(1) "Z" 60string(2) "aA" 61string(1) "9" 62string(2) "A0" 63string(1) "9" 64string(2) "a0" 65string(1) "9" 66string(2) "10" 67string(1) "Z" 68string(2) "1A" 69string(1) "z" 70string(2) "1a" 71string(2) "9z" 72string(3) "10a" 73string(3) "5e5" 74string(3) "5e6" 75string(1) "c" 76string(1) "d" 77string(1) "C" 78string(1) "D" 79string(1) "3" 80string(1) "4" 81string(1) "0" 82string(1) "1" 83