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']); var_dump($matches); //$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.70.0090.00618.81
8.3.60.0070.01418.55
8.3.50.0130.00717.64
8.3.40.0040.01119.22
8.3.30.0100.00719.09
8.3.20.0090.00021.90
8.3.10.0060.00321.90
8.3.00.0060.00321.00
8.2.180.0000.01518.43
8.2.170.0110.00722.96
8.2.160.0080.00622.21
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0030.00720.55
8.2.120.0000.00826.35
8.2.110.0100.00019.20
8.2.100.0040.00818.09
8.2.90.0030.00519.34
8.2.80.0030.00617.97
8.2.70.0050.00318.00
8.2.60.0080.00017.80
8.2.50.0090.00518.10
8.2.40.0000.00822.50
8.2.30.0050.00321.24
8.2.20.0040.00418.17
8.2.10.0000.00818.12
8.2.00.0080.00018.30
8.1.280.0040.01825.92
8.1.270.0080.00022.27
8.1.260.0030.00526.35
8.1.250.0000.00728.09
8.1.240.0060.00319.59
8.1.230.0060.00619.10
8.1.220.0040.00417.80
8.1.210.0050.00318.77
8.1.200.0060.00317.85
8.1.190.0050.00317.60
8.1.180.0040.00418.10
8.1.170.0030.00918.95
8.1.160.0000.00819.04
8.1.150.0000.00719.00
8.1.140.0000.00819.66
8.1.130.0000.00718.97
8.1.120.0000.00717.86
8.1.110.0080.00017.84
8.1.100.0030.00517.72
8.1.90.0060.00317.85
8.1.80.0000.00917.82
8.1.70.0000.00817.86
8.1.60.0060.00317.80
8.1.50.0050.00317.75
8.1.40.0000.00817.77
8.1.30.0100.00317.83
8.1.20.0030.00617.91
8.1.10.0050.00317.84
8.1.00.0000.00817.77
8.0.300.0040.00418.77
8.0.290.0040.00417.00
8.0.280.0050.00218.59
8.0.270.0080.00017.39
8.0.260.0030.00317.11
8.0.250.0000.00717.33
8.0.240.0030.00617.07
8.0.230.0080.00017.29
8.0.220.0000.00817.27
8.0.210.0040.00417.27
8.0.200.0000.00717.26
8.0.190.0060.00317.40
8.0.180.0000.00717.21
8.0.170.0040.00417.30
8.0.160.0040.00417.34
8.0.150.0040.00417.23
8.0.140.0050.00217.17
8.0.130.0080.00013.71
8.0.120.0070.00017.27
8.0.110.0030.00517.11
8.0.100.0000.00717.39
8.0.90.0050.00217.34
8.0.80.0040.01217.22
8.0.70.0050.00217.33
8.0.60.0000.00717.10
8.0.50.0000.00717.28
8.0.30.0130.00617.46
8.0.20.0120.00917.45
8.0.10.0050.00217.27
8.0.00.0100.00717.13
7.4.330.0000.00615.55
7.4.320.0000.00617.06
7.4.300.0030.00316.98
7.4.290.0070.00016.74
7.4.280.0040.00416.99
7.4.270.0000.00817.01
7.4.260.0000.00716.89
7.4.250.0030.00316.89
7.4.240.0000.00816.85
7.4.230.0000.00717.02
7.4.220.0100.01016.94
7.4.210.0080.00816.91
7.4.200.0000.00717.00
7.4.160.0090.00816.95
7.4.150.0170.00317.40
7.4.140.0110.00917.86
7.4.130.0130.01316.89
7.4.120.0140.00916.92
7.4.110.0060.01117.07
7.4.100.0070.01416.83
7.4.90.0110.00716.79
7.4.80.0060.01119.39
7.4.70.0140.00416.85
7.4.60.0080.01216.95
7.4.50.0070.01017.06
7.4.40.0070.01017.03
7.4.30.0080.00916.92
7.4.00.0090.00615.47
7.3.330.0030.00313.55
7.3.320.0000.00513.56
7.3.310.0040.00416.49
7.3.300.0040.00416.67
7.3.290.0120.00616.60
7.3.280.0090.00816.63
7.3.270.0070.01017.40
7.3.260.0090.00916.83
7.3.250.0140.00516.92
7.3.240.0080.01216.77
7.3.230.0180.00716.71
7.3.210.0030.01417.04
7.3.200.0100.01316.82
7.3.190.0130.00316.65
7.3.180.0030.01316.84
7.3.170.0120.00616.81
7.3.160.0060.01016.88
7.2.330.0090.00916.95
7.2.320.0130.00716.91
7.2.310.0100.00717.12
7.2.300.0060.00917.02
7.2.290.0060.01416.99
7.2.90.1300.00414.90
7.2.80.0140.00814.96
7.2.70.1570.00715.18
7.2.60.0070.01415.52
7.2.50.0260.01615.30
7.2.40.0170.00715.33
7.2.30.0160.00315.24
7.2.20.0860.01315.42
7.2.10.1240.01015.34
7.2.00.0130.00615.52
7.1.210.1230.00614.29
7.1.200.0080.01114.12
7.1.190.0710.00714.33
7.1.180.0100.00914.11
7.1.170.0320.00614.26
7.1.160.0090.01214.18
7.1.150.0150.00314.07
7.1.140.0390.00614.32
7.1.130.0110.00714.45
7.1.120.0120.00914.02
7.1.110.0160.00814.01
7.1.100.0980.01014.21
7.1.90.2930.01014.24
7.1.80.2470.01014.43
7.1.70.0080.00814.54
7.1.60.2000.02032.41
7.1.50.0270.02032.43
7.1.40.1320.00332.38
7.1.30.0240.01032.27
7.1.20.0270.01632.13
7.1.10.2570.00614.16
7.1.00.0030.01214.22
7.0.310.0080.01213.84
7.0.300.0390.00513.93
7.0.290.0090.01113.77
7.0.280.0130.01014.05
7.0.270.0140.00713.85
7.0.260.0380.01013.87
7.0.250.0200.00413.86
7.0.240.0070.01213.89
7.0.230.2170.00614.06
7.0.220.2070.01013.56
7.0.210.2960.00614.02
7.0.200.2440.00313.86
7.0.190.0690.00613.48
7.0.180.0770.00613.82
7.0.170.0160.01513.99
7.0.160.0090.00913.74
7.0.150.0180.00413.78
7.0.140.0110.00613.99
7.0.130.0050.00813.82
7.0.120.0110.00713.97
7.0.110.1080.01614.07
7.0.100.0870.00714.11
7.0.90.0140.00414.03
7.0.80.0090.00914.05
7.0.70.1800.00714.09
7.0.60.0110.00813.94
7.0.50.0130.00714.29
7.0.40.0110.00814.04
7.0.30.2100.00613.97
7.0.20.0100.00713.83
7.0.10.2130.00313.81
7.0.00.2220.00713.83

preferences:
79.65 ms | 401 KiB | 5 Q