3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set( 'UTC' ); function micro_time_precise_date_time_immutable( $microTime ) { $timestamp = (int) floor($microTime); $u = sprintf("%06d", ($microTime - $timestamp) * 1000000); return DateTimeImmutable::createFromFormat( 'Y-m-d H:i:s.u', date( 'Y-m-d H:i:s.'.$u, $timestamp ) ); } $mt = microtime( TRUE ); $a = DateTimeImmutable::createFromFormat('U.u', sprintf( '%.6F', $mt ) ); $b = micro_time_precise_date_time_immutable( $mt ); $format = 'Y-m-d H:i:s.u'; var_dump( $a->format( $format ) ); var_dump( $b->format( $format ) );

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)
7.4.10.0060.00914.80
7.4.00.0070.01115.03
7.3.130.0110.00715.23
7.3.120.0150.00415.13
7.3.110.0030.01615.25
7.3.100.0100.00715.29
7.3.90.0150.00015.12
7.3.80.0040.01215.20
7.3.70.0060.00915.11
7.3.60.0060.00915.25
7.3.50.0060.00315.25
7.3.40.0110.00715.24
7.3.30.0000.01215.26
7.3.20.0070.00716.96
7.3.10.0060.01017.21
7.3.00.0030.00716.73
7.2.260.0070.01315.25
7.2.250.0040.00715.22
7.2.240.0040.01115.60
7.2.230.0030.01015.54
7.2.220.0000.01815.26
7.2.210.0060.01015.27
7.2.200.0110.00615.08
7.2.190.0030.01015.06
7.2.180.0100.00615.23
7.2.170.0070.01015.23
7.2.160.0000.01015.21
7.2.150.0030.01017.14
7.2.140.0070.00717.25
7.2.130.0000.01117.11
7.2.120.0000.01717.15
7.2.110.0060.01116.93
7.2.100.0030.01317.19
7.2.90.0090.00617.05
7.2.80.0070.01017.12
7.2.70.0030.01017.30
7.2.60.0100.00316.98
7.2.50.0030.01417.16
7.2.40.0060.01317.31
7.2.30.0030.01317.32
7.2.20.0060.00917.23
7.2.10.0030.00917.24
7.2.00.0070.01016.97
7.1.330.0110.00416.10
7.1.320.0070.00715.84
7.1.310.0060.01215.82
7.1.300.0030.00915.96
7.1.290.0000.01516.22
7.1.280.0120.00316.10
7.1.270.0030.00616.19
7.1.260.0030.01015.89
7.1.250.0030.00716.16
7.1.240.0120.00316.16
7.1.230.0060.00616.17
7.1.220.0080.00515.82
7.1.210.0100.00315.88
7.1.200.0070.00616.19
7.1.190.0050.00316.28
7.1.180.0040.01116.13
7.1.170.0060.00916.01
7.1.160.0060.00715.72
7.1.150.0100.00016.10
7.1.140.0060.00615.78
7.1.130.0060.00616.14
7.1.120.0060.00616.09
7.1.110.0040.00416.02
7.1.100.0040.00415.78
7.1.90.0120.00315.69
7.1.80.0100.00715.82
7.1.70.0000.01216.25
7.1.60.0030.01215.73
7.1.50.0040.01216.07
7.1.40.0070.00716.07
7.1.30.0100.00315.73
7.1.20.0040.00715.98
7.1.10.0080.00316.10
7.1.00.0020.04319.33
7.0.330.0000.01415.85
7.0.320.0080.00815.59
7.0.310.0070.00715.75
7.0.300.0060.01015.51
7.0.290.0030.00915.59
7.0.280.0060.01015.51
7.0.270.0030.00715.86
7.0.260.0100.00315.52
7.0.250.0060.00615.88
7.0.240.0070.00315.57
7.0.230.0000.01415.92
7.0.220.0040.00415.91
7.0.210.0110.00415.75
7.0.200.0030.01015.75
7.0.190.0060.00615.55
7.0.180.0030.01015.73
7.0.170.0100.00315.57
7.0.160.0000.01315.69
7.0.150.0090.00315.82
7.0.140.0060.00915.71
7.0.130.0030.00615.98
7.0.120.0050.03918.90
7.0.110.0030.04318.84
7.0.100.0030.04018.92
7.0.90.0030.04319.01
7.0.80.0090.03719.08
7.0.70.0090.03619.06
7.0.60.0060.03819.01
7.0.50.0040.04218.93
7.0.40.0060.03318.02
7.0.30.0020.04218.06
7.0.20.0050.03817.95
7.0.10.0050.04018.09
7.0.00.0020.04018.02
5.6.400.0040.01114.59
5.6.390.0030.00714.80
5.6.380.0100.00014.59
5.6.370.0030.00714.76
5.6.360.0090.00614.61
5.6.350.0080.00414.34
5.6.340.0030.01214.50
5.6.330.0070.00714.76
5.6.320.0060.01014.50
5.6.310.0070.00714.64
5.6.300.0130.00314.68
5.6.290.0070.01014.58
5.6.280.0110.00314.64
5.6.270.0070.01014.76
5.6.260.0040.04217.83
5.6.250.0030.04317.90
5.6.240.0050.04517.76
5.6.230.0060.03817.78
5.6.220.0020.04218.01
5.6.210.0030.04217.96
5.6.200.0050.04217.65
5.6.190.0030.04217.99
5.6.180.0050.03517.94
5.6.170.0020.04217.93
5.6.160.0030.04017.78
5.6.150.0060.04017.94
5.6.140.0070.04017.93
5.6.130.0050.04017.77
5.6.120.0020.04317.82
5.6.110.0080.03817.77
5.6.100.0000.04617.82
5.6.90.0080.03518.00
5.6.80.0030.03817.50
5.6.70.0060.03817.45
5.6.60.0060.04017.53
5.6.50.0080.03317.53
5.6.40.0060.03817.51
5.6.30.0060.03617.41
5.6.20.0070.03817.39
5.6.10.0060.03717.33
5.6.00.0040.03917.54

preferences:
46.28 ms | 403 KiB | 5 Q