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));
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => NO [1] => 33% - 40% )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
59.61 ms | 401 KiB | 8 Q