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 [$fltValue, $strValue, $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 ( [0] => 2.1E-7 [1] => 0.0000002100000000 [2] => 0.0000002100000000 ) Array ( [0] => 1.2093810923802E+18 [1] => 1209381092380198144.0000000000000000 [2] => 1209381092380198144.0000000000000000 ) Array ( [0] => 90.05 [1] => 90.05 [2] => 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:
32.34 ms | 401 KiB | 8 Q