3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = 1616497508.795654549495619851562; try { print_r("Date (string) : "); var_dump($date); print_r("Date (json_encode) : "); var_dump(json_encode($date)); print_r("DateTimeImmutable::createFromFormat (string) : "); var_dump(DateTimeImmutable::createFromFormat( 'U.u', $date )); print_r("DateTimeImmutable::createFromFormat (json_encode) : "); var_dump(DateTimeImmutable::createFromFormat( 'U.u', json_encode($date) )); print_r("DateTimeImmutable::createFromFormat \"1616497508.7956545\" : "); var_dump(DateTimeImmutable::createFromFormat( 'U.u', "1616497508.7956545" )); print_r("DateTimeImmutable::createFromFormat \"1616497508.9999999\" : "); var_dump(DateTimeImmutable::createFromFormat( 'U.u', "1616497508.9999999" )); print_r("DateTimeImmutable::createFromFormat \"1616497508.99999999\" : "); var_dump(DateTimeImmutable::createFromFormat( 'U.u', "1616497508.99999999" )); } catch (\Exception $e) { var_dump($e); }
Output for git.master, git.master_jit, rfc.property-hooks
Date (string) : float(1616497508.7956545) Date (json_encode) : string(18) "1616497508.7956545" DateTimeImmutable::createFromFormat (string) : object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2021-03-23 11:05:08.795700" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } DateTimeImmutable::createFromFormat (json_encode) : bool(false) DateTimeImmutable::createFromFormat "1616497508.7956545" : bool(false) DateTimeImmutable::createFromFormat "1616497508.9999999" : bool(false) DateTimeImmutable::createFromFormat "1616497508.99999999" : 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:
32.04 ms | 402 KiB | 8 Q