3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php echo set_markup(10001); function set_markup($total_price) { $total_price = (int)$total_price; switch($total_price) { case ($total_price >= 0 && $total_price <= 9999): $markup_percent = 25; break; case ($total_price >= 10000 && $total_price <= 25000): $markup_percent = 20; break; case ($total_price >= 25001 && $total_price <= 99999): $markup_percent = 15; break; case ($total_price >= 100000 && $total_price <= 999999): $markup_percent = 10; break; case ($total_price >= 1000000 && $total_price <= 20000000): $markup_percent = 5; break; default: $markup_percent = 0; break; } return $markup_percent; }
based on p4nm7
Output for 4.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
20
Output for hhvm-3.10.0

Process exited with code 153.