3v4l.org

run code in 300+ PHP versions simultaneously
<?php function checkFloat(&$var) { if (is_float($var) || is_numeric($var)) { $var = unpack("f", pack("f", $var))[1]; } else { throw new \Exception("Expect float."); } } $var = 0.9; checkFloat($var); var_dump($var); $var = 0.7; checkFloat($var); var_dump($var); $var = 0.3; checkFloat($var); var_dump($var); $var = 0.1; checkFloat($var); var_dump($var);
Output for git.master, git.master_jit, rfc.property-hooks
float(0.8999999761581421) float(0.699999988079071) float(0.30000001192092896) float(0.10000000149011612)

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:
59.79 ms | 405 KiB | 5 Q