3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str = '138201162401719'; $arr = str_split($str); $i = 0; while ($i < count($arr)) { $n = substr($str, $i, 2); echo $n."\n"; $firstchar = substr($n, 0, 1); if ($n < 26 && $firstchar != 0) { $result[] = substr($str, $i, 2); $i += 2; } else { $result[] = substr($str, $i, 1); $i++; } } echo implode(', ', $result);
Output for 5.0.0 - 7.1.0
13 82 20 11 62 24 01 17 19 13, 8, 20, 11, 6, 24, 0, 17, 19
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: str_split() in /in/sVN1V on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: str_split() in /in/sVN1V on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: str_split() in /in/sVN1V on line 4