3v4l.org

run code in 300+ PHP versions simultaneously
<?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))

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
7.2.110.0150.00714.30

preferences:
131.02 ms | 1394 KiB | 7 Q