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); }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.60.0070.00716.88
8.3.50.0150.00618.50
8.3.40.0000.01618.92
8.3.30.0070.01319.08
8.3.20.0110.00324.18
8.3.10.0070.00424.66
8.3.00.0000.00826.16
8.2.180.0070.01125.92
8.2.170.0090.00619.34
8.2.160.0060.00922.96
8.2.150.0000.00825.66
8.2.140.0070.00724.66
8.2.130.0080.00026.16
8.2.120.0040.00426.35
8.2.110.0070.01121.32
8.2.100.0090.00517.97
8.2.90.0000.00818.28
8.2.80.0000.01020.01
8.2.70.0060.00317.88
8.2.60.0040.00417.88
8.2.50.0030.00618.18
8.2.40.0000.00819.93
8.2.30.0000.00718.20
8.2.20.0080.00018.40
8.2.10.0040.00419.60
8.2.00.0040.00419.61
8.1.280.0040.01425.92
8.1.270.0040.00423.99
8.1.260.0070.01128.09
8.1.250.0050.00228.09
8.1.240.0090.00022.97
8.1.230.0000.01021.15
8.1.220.0030.00617.90
8.1.210.0030.00518.88
8.1.200.0080.00017.59
8.1.190.0000.00817.60
8.1.180.0040.00418.10
8.1.170.0030.00617.82
8.1.160.0000.00719.11
8.1.150.0000.00719.11
8.1.140.0060.00319.19
8.1.130.0030.00320.27
8.1.120.0040.00417.72
8.1.110.0030.00517.63
8.1.100.0000.00817.75
8.1.90.0030.00617.64
8.1.80.0000.01017.80
8.1.70.0030.00317.80
8.1.60.0000.00817.78
8.1.50.0050.00517.77
8.1.40.0100.00017.77
8.1.30.0060.00317.94
8.1.20.0000.00817.85
8.1.10.0040.00417.84
8.1.00.0090.00317.77
8.0.300.0070.00020.21
8.0.290.0040.00417.13
8.0.280.0050.00318.68
8.0.270.0030.00318.32
8.0.260.0060.00318.76
8.0.250.0000.00717.31
8.0.240.0000.00717.43
8.0.230.0030.00317.29
8.0.220.0070.00017.30
8.0.210.0030.00317.34
8.0.200.0040.00417.25
8.0.190.0030.00617.40
8.0.180.0000.00717.32
8.0.170.0000.00817.34
8.0.160.0000.00717.39
8.0.150.0040.00417.21
8.0.140.0000.00717.32
8.0.130.0030.00313.67
8.0.120.0050.00517.24
8.0.110.0020.00517.29
8.0.100.0000.00717.26
8.0.90.0070.00017.27
8.0.80.0080.01017.09
8.0.70.0000.00717.13
8.0.60.0000.00717.22
8.0.50.0000.00717.34
8.0.30.0050.01217.13
8.0.20.0040.01217.25
8.0.10.0090.01017.28
8.0.00.0130.00817.30
7.4.330.0000.00615.55
7.4.320.0030.00316.79
7.4.300.0050.00516.85
7.4.290.0000.00816.68
7.4.280.0000.00716.86
7.4.270.0070.00016.75
7.4.260.0000.00513.60
7.4.250.0000.00816.83
7.4.240.0000.00716.76
7.4.230.0040.00416.68
7.4.220.0020.00516.76
7.4.210.0050.01016.67
7.4.200.0030.00316.91
7.4.160.0000.01716.76
7.4.150.0100.00816.68
7.4.140.0100.00716.60
7.4.130.0150.00416.47
7.4.120.0080.01116.50
7.4.110.0050.00916.45
7.4.100.0060.01316.72
7.4.90.0040.01416.67
7.4.80.0120.00416.46
7.4.70.0110.00716.50
7.4.60.0080.00616.53
7.4.50.0040.01116.58
7.4.40.0090.00616.54
7.4.30.0140.00216.66
7.4.20.0130.00616.55
7.4.10.0070.00716.57
7.4.00.0100.00416.62
7.3.330.0030.00616.57
7.3.320.0050.00213.28
7.3.310.0040.00416.37
7.3.300.0060.00016.45
7.3.290.0040.01116.50
7.3.270.0120.00516.45
7.3.260.0080.00916.41
7.3.250.0100.01116.49
7.3.240.0070.01016.48
7.3.230.0030.01516.49
7.3.220.0090.00816.47
7.3.210.0110.00416.44
7.3.200.0080.00716.39
7.3.190.0130.00516.41
7.3.180.0090.00516.43
7.3.170.0060.00816.45
7.3.160.0070.00816.43
7.3.150.0020.01316.48
7.3.140.0040.01216.32
7.3.130.0120.00516.37
7.3.120.0080.00816.38
7.3.110.0070.00916.32
7.3.100.0140.00516.35
7.3.90.0090.00716.57
7.3.80.0070.01416.34
7.3.70.0090.00516.37
7.3.60.0050.00916.52
7.3.50.0050.00916.49
7.3.40.0050.00916.49
7.3.30.0070.00616.51
7.3.20.0050.00916.50
7.3.10.0080.00716.34
7.3.00.0070.00716.42

preferences:
61.08 ms | 400 KiB | 5 Q