3v4l.org

run code in 300+ PHP versions simultaneously
<?php function resize($count) { $n = $count % 10; //round the count to the nearest 10... $size = ($n > 5) ? $count - $n : $count + $n; //normalise the size to be between 10 and 100 if ($size < 10) { $size = 10; } elseif ($size > 100) { $size = 100; } //normalise the size to be between 1 and 10 $size = $size/10; return $size; } var_dump(resize(63)); var_dump(resize(65)); var_dump(resize(13)); var_dump(resize(15)); var_dump(resize(21));
Output for git.master, git.master_jit, rfc.property-hooks
float(6.6) int(7) float(1.6) int(2) float(2.2)

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