3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Shipping { /** * @return integer The minimum number of boxes needed to hold a given number of items */ public static function minimalNumberOfPackages($items, $availableLargePackages, $availableSmallPackages) { $maxSize = $availableLargePackages * 5; $minSize = $availableSmallPackages * 1; if ($items > $maxSize + $minSize) return -1; var_dump($items % $availableLargePackages, $items / $availableLargePackages); return NULL; } } echo Shipping::minimalNumberOfPackages(10, 30, 10);
Output for git.master, git.master_jit, rfc.property-hooks
int(10) float(0.3333333333333333)

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:
28.52 ms | 1405 KiB | 4 Q