3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = 1616497608.0510409; $b = 1616497608; var_dump(json_encode($a)); var_dump(json_encode((float) $a)); var_dump(json_encode($b)); var_dump(json_encode((float) $b)); var_dump(DateTimeImmutable::createFromFormat('U.u', $a)); var_dump(DateTimeImmutable::createFromFormat('U.u', (float) $b)); var_dump(DateTimeImmutable::createFromFormat('U.u', floatval($b)));
Output for git.master, git.master_jit, rfc.property-hooks
string(17) "1616497608.051041" string(17) "1616497608.051041" string(10) "1616497608" string(10) "1616497608" object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2021-03-23 11:06:48.051000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } bool(false) bool(false)

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