3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class AliasPool { protected static $i = 0; public static function get () { $alias = ''; $j = self::$i; $done = false; while (!$done) { if ($j == 0) { $done = true; } $alias = chr(($j % 26) + ord('a')) . $alias; $j = floor($j / 26); } self::$i++; return $alias; } } for ($i = 0; $i < 60; ++$i) { var_dump(AliasPool::get()); print "\n"; }
Output for 5.0.0 - 7.2.0
string(1) "a" string(2) "ab" string(2) "ac" string(2) "ad" string(2) "ae" string(2) "af" string(2) "ag" string(2) "ah" string(2) "ai" string(2) "aj" string(2) "ak" string(2) "al" string(2) "am" string(2) "an" string(2) "ao" string(2) "ap" string(2) "aq" string(2) "ar" string(2) "as" string(2) "at" string(2) "au" string(2) "av" string(2) "aw" string(2) "ax" string(2) "ay" string(2) "az" string(3) "aba" string(3) "abb" string(3) "abc" string(3) "abd" string(3) "abe" string(3) "abf" string(3) "abg" string(3) "abh" string(3) "abi" string(3) "abj" string(3) "abk" string(3) "abl" string(3) "abm" string(3) "abn" string(3) "abo" string(3) "abp" string(3) "abq" string(3) "abr" string(3) "abs" string(3) "abt" string(3) "abu" string(3) "abv" string(3) "abw" string(3) "abx" string(3) "aby" string(3) "abz" string(3) "aca" string(3) "acb" string(3) "acc" string(3) "acd" string(3) "ace" string(3) "acf" string(3) "acg" string(3) "ach"
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/0knTm on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/0knTm on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/0knTm on line 3
Process exited with code 255.