3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $amount = 799000; $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[] = substr($temp, 0, 2); } } else { if(!$temp) { $number_sep[] = $i; } else { $number_sep[] = substr($temp, 0, 2); } echo $temp $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 '$exit' (T_VARIABLE), expecting ',' or ';' in /in/M8Zmv on line 44
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.27
Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in /in/M8Zmv on line 44
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_VARIABLE, expecting ',' or ';' in /in/M8Zmv on line 44
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `','' or `';'' in /in/M8Zmv on line 44
Process exited with code 255.