3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $amount = 2003 $number_sep = array(); $multi = 1; $exit = false; $i = 1000; for($j=3;$j < 15 ;$j=$j+2) { switch($j) { case 3: $temp = fmod($amount, $i); if($i < $amount) { if(!$temp) { $number_sep[] = $i; } else { $amount = $amount - $temp; $number_sep[] = round($temp,2); } } else { if(!$temp) { $number_sep[] = $i; } else { $number_sep[] = round($temp,2); } $exit = true; } break; case $j > 3 : $temp = $amount % $i; if($i < $amount) { if(!$temp) { $number_sep[] = $i; } else { $amount = $amount - $temp; $number_sep[] = $temp/($i/100); } } else { if(!$temp) { $number_sep[] = $i; } else { $number_sep[] = $temp/($i/100); } $exit = true; }; break; } if($exit) { break; } $i = 10 * 10 * $i; } echo implode(',',array_reverse($number_sep));
Output for 5.4.0 - 5.4.19
Parse error: syntax error, unexpected '$number_sep' (T_VARIABLE) in /in/Ko3Q1 on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_VARIABLE in /in/Ko3Q1 on line 3
Process exited with code 255.