3v4l.org

run code in 300+ PHP versions simultaneously
<?php $base = 100000; $purchaseprice = 150000; $basefee = 4600; $addfee = 700; $addincrement = 50000; $tempprice = max($purchaseprice - $base, 0); $increments = ( $tempprice > 0 ? intdiv($tempprice, $addincrement) : 0); if($purchaseprice % $addincrement == 0) { $increments++; } $finalprice = $purchaseprice + $basefee + ($increments * $addfee); print "Purchase price: {$purchaseprice}, Base Fee: {$basefee}, Increments: {$increments} x {$addfee}, Final Price: {$finalprice}"; ?>
Output for git.master, git.master_jit, rfc.property-hooks
Purchase price: 150000, Base Fee: 4600, Increments: 2 x 700, Final Price: 156000

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:
32.79 ms | 401 KiB | 8 Q