3v4l.org

run code in 300+ PHP versions simultaneously
<?php function float_strval($fltValue) { $strValue = (string)$fltValue; if (preg_match("/E([\+\-])(\d+)$/", $strValue, $captures)) { if ($captures[1] === '-') { $strValue = number_format($fltValue, $captures[2], '.', ''); } else { $strValue = number_format($fltValue, 0, '.', ''); } } return [$fltValue, $strValue]; } var_dump(float_strval(0.00000021)); var_dump(float_strval(1209381092380198230.123));
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { [0]=> float(2.1E-7) [1]=> string(9) "0.0000002" } array(2) { [0]=> float(1.2093810923801981E+18) [1]=> string(19) "1209381092380198144" }

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