3v4l.org

run code in 300+ PHP versions simultaneously
<?php # how i can round 4.3 to 4.5, 4.2 to 4.0, 4.7 to 4.5 and 4.8 to 5.0 ? function bogoround($x) { static $calls = 0; $results = [4.5,4.0,4.5,5.0]; return $results[$calls++]; } var_dump(bogoround(4.3)); var_dump(bogoround(4.2)); var_dump(bogoround(4.7)); var_dump(bogoround(4.8));
Output for git.master, git.master_jit, rfc.property-hooks
float(4.5) float(4) float(4.5) float(5)

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