3v4l.org

run code in 300+ PHP versions simultaneously
<?php function float_strval($fltValue) { $strValue = (string)$fltValue; if (preg_match("/E[\+\-]\d+$/", $strValue)) { $strValue = number_format($fltValue, 16, '.', ''); } $oldStrValue = number_format($fltValue, 16, '.', ''); return ['in!'=>$fltValue, 'out'=>$strValue, 'old'=>$oldStrValue]; } print_r(float_strval(0.00000021)); print_r(float_strval(1209381092380198230.123)); print_r(float_strval(90.05));
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [in!] => 2.1E-7 [out] => 0.0000002100000000 [old] => 0.0000002100000000 ) Array ( [in!] => 1.2093810923802E+18 [out] => 1209381092380198144.0000000000000000 [old] => 1209381092380198144.0000000000000000 ) Array ( [in!] => 90.05 [out] => 90.05 [old] => 90.0499999999999972 )

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:
27.09 ms | 406 KiB | 5 Q