3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dateTimeExample = new DateTime('2009-01-05 12:34:56'); $dateTimes = [ $dateTimeExample->format('Y-m-d H:i:s'), $dateTimeExample->format('c'), $dateTimeExample->format('Y-m-d') ]; var_dump($dateTimes); foreach($dateTimes as $input){ preg_match('~(?<date>\d{4}-\d{2}-\d{2})[\s|T]?(?<time>\d{2}:\d{2}:\d{2})?(?<timezone>[\+|-]\d{2}:\d{2})?~', $input, $matches); $matches['time'] = array_key_exists('time', $matches) ? $matches['time'] : '00:00:00'; $dateTime = sprintf('%s %s', $matches['date'], $matches['time']); $timeZone = array_key_exists('timezone', $matches) ? new \DateTimeZone($matches['timezone']) : new \DateTimeZone('Europe/Amsterdam'); var_dump(\DateTime::createFromFormat('Y-m-d H:i:s', $dateTime, $timeZone)); }

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.0160.00618.68
8.3.50.0140.00016.68
8.3.40.0090.00619.05
8.3.30.0090.00618.93
8.3.20.0050.00520.17
8.3.10.0060.00321.60
8.3.00.0080.00021.01
8.2.180.0080.00818.64
8.2.170.0140.00022.96
8.2.160.0140.00422.04
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0000.00820.51
8.2.120.0000.00726.35
8.2.110.0170.00321.17
8.2.100.0040.00818.09
8.2.90.0000.00819.40
8.2.80.0060.00317.97
8.2.70.0090.00017.88
8.2.60.0030.00518.05
8.2.50.0030.00618.16
8.2.40.0030.00522.07
8.2.30.0040.00421.19
8.2.20.0000.00718.13
8.2.10.0040.00418.23
8.2.00.0000.00718.05
8.1.280.0160.00625.92
8.1.270.0090.00022.00
8.1.260.0090.00026.35
8.1.250.0080.00028.09
8.1.240.0030.00719.47
8.1.230.0070.00419.16
8.1.220.0040.00417.77
8.1.210.0050.00318.77
8.1.200.0000.01017.85
8.1.190.0030.00517.72
8.1.180.0000.00818.10
8.1.170.0070.00718.96
8.1.160.0040.00419.13
8.1.150.0000.00920.77
8.1.140.0020.00519.70
8.1.130.0030.00319.01
8.1.120.0040.00417.75
8.1.110.0000.00817.88
8.1.100.0030.00617.81
8.1.90.0000.00817.90
8.1.80.0000.00717.82
8.1.70.0030.00317.72
8.1.60.0000.00917.90
8.1.50.0030.00617.88
8.1.40.0090.00017.85
8.1.30.0040.01117.95
8.1.20.0040.00417.96
8.1.10.0000.00817.79
8.1.00.0040.00417.75
8.0.300.0000.00818.77
8.0.290.0040.00417.13
8.0.280.0040.00418.56
8.0.270.0070.00017.38
8.0.260.0030.00318.56
8.0.250.0030.00317.21
8.0.240.0000.01017.17
8.0.230.0090.00017.34
8.0.220.0000.00717.26
8.0.210.0050.00217.27
8.0.200.0000.00717.19
8.0.190.0060.00317.30
8.0.180.0040.00417.18
8.0.170.0050.00317.19
8.0.160.0030.00617.29
8.0.150.0040.00417.26
8.0.140.0000.00717.16
8.0.130.0030.00513.70
8.0.120.0040.00417.24
8.0.110.0040.00417.23
8.0.100.0040.00417.27
8.0.90.0000.00717.11
8.0.80.0160.00017.32
8.0.70.0040.00417.30
8.0.60.0000.00717.13
8.0.50.0080.00017.14
8.0.30.0120.00817.53
8.0.20.0130.00817.53
8.0.10.0050.00217.17
8.0.00.0100.00816.99
7.4.330.0030.00315.55
7.4.320.0030.00316.80
7.4.300.0000.00616.89
7.4.290.0030.00516.88
7.4.280.0060.00316.77
7.4.270.0040.00316.99
7.4.260.0040.00416.92
7.4.250.0040.00416.99
7.4.240.0000.00716.82
7.4.230.0050.00316.98
7.4.220.0140.01116.93
7.4.210.0000.01417.03
7.4.200.0000.00717.00
7.4.160.0100.00716.88
7.4.150.0140.00517.40
7.4.140.0110.00817.86
7.4.130.0140.00716.79
7.4.120.0120.00916.90
7.4.110.0090.00916.88
7.4.100.0160.00616.86
7.4.90.0090.01216.87
7.4.80.0090.01019.39
7.4.70.0040.01316.83
7.4.60.0060.01016.86
7.4.50.0030.01116.97
7.4.40.0120.00917.03
7.4.30.0060.01216.87
7.4.00.0030.01715.20
7.3.330.0030.00313.42
7.3.320.0030.00313.43
7.3.310.0020.00516.70
7.3.300.0040.00416.56
7.3.290.0090.00816.62
7.3.280.0080.01116.64
7.3.270.0060.01317.40
7.3.260.0130.00516.76
7.3.250.0120.00816.77
7.3.240.0140.00716.86
7.3.230.0050.01516.82
7.3.210.0180.00016.70
7.3.200.0070.01016.70
7.3.190.0080.00816.66
7.3.180.0160.00316.73
7.3.170.0060.01217.08
7.3.160.0110.00616.87
7.3.120.0060.01315.30
7.3.110.0060.00615.19
7.3.100.0090.00615.51
7.3.90.0040.00815.06
7.3.80.0060.01215.18
7.3.70.0070.00715.22
7.3.60.0030.01315.26
7.3.50.0080.00315.27
7.3.40.0090.00615.10
7.3.30.0030.00914.95
7.3.20.0050.00816.91
7.3.10.0090.00617.13
7.3.00.0060.00916.91
7.2.330.0080.01216.96
7.2.320.0120.01217.09
7.2.310.0100.00716.93
7.2.300.0150.00417.09
7.2.290.0040.01316.94
7.2.250.0030.01515.52
7.2.240.0030.01715.29
7.2.230.0070.00715.44
7.2.220.0030.01015.61
7.2.210.0030.01215.63
7.2.200.0070.00315.49
7.2.190.0100.00315.37
7.2.180.0090.00615.29
7.2.170.0040.00715.52
7.2.160.0070.00715.48
7.2.150.0060.00917.39
7.2.140.0030.00917.39
7.2.130.0090.00617.30
7.2.120.0120.00417.30
7.2.110.0000.01017.11
7.2.100.0040.01417.27
7.2.90.0030.01017.20
7.2.80.0030.01317.03
7.2.70.0090.00317.33
7.2.60.0020.01117.25
7.2.50.0070.00517.45
7.2.40.0080.00317.28
7.2.30.0070.00517.35
7.2.20.0080.00617.08
7.2.10.0050.01117.40
7.2.00.0060.00817.32
7.1.330.0070.00716.19
7.1.320.0090.00616.38
7.1.310.0060.00316.32
7.1.300.0090.00016.35
7.1.290.0030.00615.93
7.1.280.0000.01615.99
7.1.270.0060.00616.14
7.1.260.0080.00016.37
7.1.250.0000.01016.01
7.1.210.0050.00516.15
7.1.200.0100.00216.22
7.1.190.0060.00616.24
7.1.180.0060.00616.12
7.1.170.0060.01216.02
7.1.160.0050.00515.95
7.1.150.0090.00315.94
7.1.140.0070.00616.25
7.1.130.0030.00916.13
7.1.120.0060.00616.13
7.1.110.0100.00315.81
7.1.100.0060.00616.15
7.1.90.0030.00915.89
7.1.80.0040.00816.25
7.1.70.0060.00616.33
7.1.60.0240.00834.06
7.1.50.0210.01234.29
7.1.40.0320.00934.27
7.1.30.0160.01434.07
7.1.20.0140.01734.18
7.1.10.0110.00016.24
7.1.00.0080.00416.27
7.0.310.0070.00415.64
7.0.300.0000.01115.78
7.0.290.0070.00415.60
7.0.280.0100.00015.84
7.0.270.0040.00715.80
7.0.260.0040.00715.68
7.0.250.0060.00615.75
7.0.240.0030.00915.74
7.0.230.0000.01215.80
7.0.220.0090.00315.82
7.0.210.0040.00815.65
7.0.200.0060.00615.55
7.0.190.0000.01215.82
7.0.180.0040.00715.83
7.0.170.0070.00515.79
7.0.160.0080.00415.79
7.0.150.0040.00815.74
7.0.140.0090.00315.55
7.0.130.1910.00615.66
7.0.120.0080.00315.83
7.0.110.0100.00015.74
7.0.100.0080.00815.82
7.0.90.0030.01015.77
7.0.80.0030.01115.47
7.0.70.0000.01215.79
7.0.60.0080.00315.70
7.0.50.0080.00815.68
7.0.40.0130.00015.58
7.0.30.0040.00915.56
7.0.20.0100.00315.91
7.0.10.0080.00715.68
7.0.00.0050.00715.91

preferences:
54.56 ms | 401 KiB | 5 Q