3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isEqual($a, $b, $epsilon = 1e-10) { if ( float($a) == float($b) ) // handles infinites return true; if ( (float)$a * (float)$b == 0 ) // a or b or both are zero return abs((float)$a - (float)$b) < ( $epsilon * $epsilon ); return (abs((float)$a - (float)$b) / (abs((float)$a) + abs((float)$b))) < $epsilon; } for ( $i = 0; $i < 10000; $i++ ) isEqual(0.000001, 0.000001);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function float() in /in/EdclV:4 Stack trace: #0 /in/EdclV(14): isEqual(1.0E-6, 1.0E-6) #1 {main} thrown in /in/EdclV on line 4
Process exited with code 255.

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