3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php //Function to check if margin is OK or not function check_margin($vpc, $bruto_margin_avg) { if ($vpc >= 1 && $vpc <= 15000) { if ($bruto_margin_avg >= 33 && $bruto_margin_avg <= 40) { //IF VPC is between 0-15000kn and bruto margin is between 33-40% $bruto = 'OK'; $comment = '1'; } else { $bruto = 'NO'; $comment = '33% - 40%'; } } if ($vpc >= 15000 && $vpc <= 50000) { if ($bruto_margin_avg >= 0 && $bruto_margin_avg <= 2) { $bruto = 'OK'; $comment = '2'; } else { $bruto = 'NO'; $comment = '25% - 30%'; } } if ($vpc >= 50000 && $vpc <= 80000) { if ($bruto_margin_avg >= 23 && $bruto_margin_avg <= 27) { $bruto = 'OK'; $comment = '3'; } else { $bruto = 'NO'; $comment = '23% - 27%'; } } if ($vpc > 80000) { if ($bruto_margin_avg > 21) { $bruto = 'OK'; $comment = ''; } else { $bruto = 'NO'; $comment = '> 21%'; } } return array($bruto, $comment); } $vpc = 1560.00; $bruto_margin_avg = 14.952937358001; print_r(check_margin($vpc, $bruto_margin_avg))
Output for 7.2.11
Parse error: syntax error, unexpected end of file in /in/8sLCq on line 51
Process exited with code 255.