3v4l.org

run code in 300+ PHP versions simultaneously
<?php $amount = 12302342340; $number_sep = array(); $multi = 1; $exit = false; for($i = 10,$j=1;$i < 9 ; $i * 10 * $multi,$j=$j+2;) { switch($j) { case 3: $temp = $amount % $i; if($i < $amount) { if(!$temp) { $number_sep[] = $i; } else { $amount = $amount - $temp; $number_sep[] = $temp; } } else { if(!$temp) { $number_sep[] = $i; } else { $number_sep[] = $temp; } $exit = true; } break; case $j > 3 : $temp = $amount % $i; if($i < $amount) { if(!$temp) { $number_sep[] = $i; } else { $amount = $amount - $temp; $number_sep[] = $temp; } } else { if(!$temp) { $number_sep[] = $i; } else { $number_sep[] = $temp; } $exit = true; }; break; } if($exit) { break; } $multi = 10 * 10 * $i; } echo implode(',',$number_sep);
Output for 5.4.18 - 5.4.19
Parse error: syntax error, unexpected ';', expecting ')' in /in/uTFg9 on line 6
Process exited with code 255.
Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.17
Parse error: syntax error, unexpected ';', expecting ')' in /in/1P94X on line 6
Process exited with code 255.

preferences:
175.78 ms | 1395 KiB | 55 Q