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)->format('c')); }

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.01418.80
8.3.50.0060.00916.89
8.3.40.0120.00318.86
8.3.30.0090.00619.22
8.3.20.0090.00020.15
8.3.10.0060.00321.82
8.3.00.0050.00320.89
8.2.180.0060.01018.79
8.2.170.0120.00322.96
8.2.160.0110.00422.25
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0050.00320.32
8.2.120.0040.00426.35
8.2.110.0030.01020.47
8.2.100.0110.00018.28
8.2.90.0030.00519.34
8.2.80.0000.00817.97
8.2.70.0040.00417.88
8.2.60.0080.00017.93
8.2.50.0070.00418.10
8.2.40.0040.00422.35
8.2.30.0030.00621.25
8.2.20.0000.00718.16
8.2.10.0050.00318.26
8.2.00.0040.00418.24
8.1.280.0090.01225.92
8.1.270.0080.00022.27
8.1.260.0050.00326.35
8.1.250.0050.00328.09
8.1.240.0000.00922.56
8.1.230.0040.01119.22
8.1.220.0040.00418.03
8.1.210.0000.00818.77
8.1.200.0050.00517.72
8.1.190.0030.00617.60
8.1.180.0090.00018.10
8.1.170.0100.00018.88
8.1.160.0000.00719.07
8.1.150.0030.00520.68
8.1.140.0070.00019.70
8.1.130.0000.00718.89
8.1.120.0000.00817.83
8.1.110.0050.00217.80
8.1.100.0030.00617.86
8.1.90.0050.00317.74
8.1.80.0040.00417.85
8.1.70.0030.00317.76
8.1.60.0030.00617.82
8.1.50.0050.00317.83
8.1.40.0080.00017.72
8.1.30.0100.00017.80
8.1.20.0000.00817.95
8.1.10.0000.00817.90
8.1.00.0040.00417.77
8.0.300.0040.00418.77
8.0.290.0000.00717.00
8.0.280.0030.00318.52
8.0.270.0070.00017.38
8.0.260.0000.00817.20
8.0.250.0000.00717.40
8.0.240.0090.00317.15
8.0.230.0050.00317.32
8.0.220.0040.00317.30
8.0.210.0000.00717.28
8.0.200.0030.00317.30
8.0.190.0000.00817.29
8.0.180.0040.00417.22
8.0.170.0000.00717.25
8.0.160.0040.00417.33
8.0.150.0000.00817.25
8.0.140.0040.00417.25
8.0.130.0040.00413.74
8.0.120.0000.00817.29
8.0.110.0070.00017.19
8.0.100.0000.00817.13
8.0.90.0000.00817.39
8.0.80.0070.01417.22
8.0.70.0040.00417.07
8.0.60.0000.00717.22
8.0.50.0040.00417.15
8.0.30.0140.00517.48
8.0.20.0100.01117.68
8.0.10.0000.00817.42
8.0.00.0060.01617.25
7.4.330.0030.00315.55
7.4.320.0030.00316.96
7.4.300.0080.00016.99
7.4.290.0000.01016.80
7.4.280.0030.00616.82
7.4.270.0040.00416.74
7.4.260.0070.00017.00
7.4.250.0000.00716.94
7.4.240.0000.00716.84
7.4.230.0040.00416.82
7.4.220.0170.01016.95
7.4.210.0070.01316.98
7.4.200.0000.00716.79
7.4.160.0120.00817.06
7.4.150.0140.00717.40
7.4.140.0100.01017.86
7.4.130.0050.01516.96
7.4.120.0140.00416.87
7.4.110.0070.01716.88
7.4.100.0090.01417.07
7.4.90.0090.01616.80
7.4.80.0100.01319.39
7.4.70.0100.00716.70
7.4.60.0130.00316.82
7.4.50.0120.00617.02
7.4.40.0110.00716.88
7.4.30.0120.00616.80
7.4.10.0120.00315.54
7.4.00.0030.01315.43
7.3.330.0030.00313.52
7.3.320.0060.00013.52
7.3.310.0030.00316.54
7.3.300.0030.00316.56
7.3.290.0080.00916.62
7.3.280.0080.00816.63
7.3.270.0040.01517.40
7.3.260.0080.00916.80
7.3.250.0100.00816.74
7.3.240.0080.00916.84
7.3.230.0090.00916.71
7.3.210.0140.00616.84
7.3.200.0130.01016.84
7.3.190.0040.01416.93
7.3.180.0060.01016.81
7.3.170.0130.00316.89
7.3.160.0070.01416.83
7.3.130.0060.01115.24
7.3.120.0040.01215.19
7.3.110.0050.01015.28
7.3.100.0060.00815.14
7.3.90.0020.01115.16
7.3.80.0030.01214.94
7.3.70.0060.00814.96
7.3.60.0070.00815.18
7.3.50.0030.00715.26
7.3.40.0040.00615.06
7.3.30.0060.00815.14
7.3.20.0070.00616.91
7.3.10.0060.00916.97
7.3.00.0080.00817.12
7.2.330.0090.00917.00
7.2.320.0130.01617.13
7.2.310.0140.00717.16
7.2.300.0030.01417.18
7.2.290.0040.01517.18
7.2.260.0060.01215.50
7.2.250.0060.01315.39
7.2.240.0050.00815.23
7.2.230.0100.00515.51
7.2.220.0050.00815.30
7.2.210.0030.01115.65
7.2.200.0090.00715.47
7.2.190.0020.01315.56
7.2.180.0050.01015.35
7.2.170.0100.00815.31
7.2.160.0080.00815.37
7.2.150.0050.00817.33
7.2.140.0070.00517.22
7.2.130.0060.01217.32
7.2.120.0060.00917.24
7.2.110.0090.00917.21
7.2.100.0070.00617.35
7.2.90.0110.00716.64
7.2.80.0220.00716.70
7.2.70.0280.01016.80
7.2.60.0060.00916.79
7.2.50.0140.01116.84
7.2.40.0130.01016.87
7.2.30.0050.01116.83
7.2.20.0090.00616.76
7.2.10.0380.00716.84
7.2.00.0380.00916.92
7.1.330.0060.00816.18
7.1.320.0080.00816.34
7.1.310.0040.00716.19
7.1.300.0050.00616.12
7.1.290.0070.00515.93
7.1.280.0050.00916.23
7.1.270.0050.00516.27
7.1.260.0050.00716.04
7.1.250.0050.01016.07
7.1.240.0030.01016.12
7.1.230.0040.00716.33
7.1.220.0030.00516.14
7.1.210.0040.00815.36
7.1.200.0130.00215.22
7.1.190.0850.00515.07
7.1.180.0100.00515.27
7.1.170.0460.00515.19
7.1.160.0680.00615.38
7.1.150.0650.00815.25
7.1.140.0540.00815.13
7.1.130.0530.00515.17
7.1.120.1070.00915.18
7.1.110.0240.00315.23
7.1.100.0850.00715.27
7.1.90.0230.00915.26
7.1.80.0680.00515.29
7.1.70.0760.00815.29
7.1.60.0710.01024.28
7.1.50.0180.01023.99
7.1.40.0400.00524.22
7.1.30.0710.00524.31
7.1.20.0320.00824.20
7.1.10.0410.00515.04
7.1.00.0770.00515.37
7.0.330.0070.00715.77
7.0.320.0070.00415.75
7.0.310.0260.00514.75
7.0.300.0090.00814.89
7.0.290.0140.00714.75
7.0.280.0070.00514.79
7.0.270.0540.01014.97
7.0.260.1210.00914.88
7.0.250.0710.00315.00
7.0.240.1110.00814.81
7.0.230.0050.01114.74
7.0.220.0070.00814.71
7.0.210.0880.01014.76
7.0.200.0110.00514.89
7.0.190.0050.01114.94
7.0.180.0060.00814.85
7.0.170.0570.00714.99
7.0.160.0090.00414.84
7.0.150.0090.00814.98
7.0.140.0520.00714.91
7.0.130.0720.00614.73
7.0.120.0940.01014.87
7.0.110.0630.00514.82
7.0.100.0910.00514.87
7.0.90.0980.00514.69
7.0.80.0720.00814.77
7.0.70.0880.00614.87
7.0.60.0540.00814.82
7.0.50.1070.00814.98
7.0.40.0620.00713.96
7.0.30.0680.00213.98
7.0.20.0630.00913.90
7.0.10.1190.00513.77
7.0.00.0780.01013.92
5.6.400.0070.00714.81
5.6.390.0030.01014.65
5.6.380.0060.00814.52
5.6.370.0040.00814.89
5.6.360.0030.00614.64
5.6.350.0040.01114.62
5.6.340.0080.00414.84
5.6.330.0030.00714.48
5.6.320.0110.00314.66
5.6.310.0060.00614.70
5.6.300.0100.00714.65
5.6.290.0110.00714.41
5.6.280.0070.01014.80
5.6.270.0030.01314.55
5.6.260.0080.00414.63
5.6.250.0080.00414.79
5.6.240.0030.01014.36
5.6.230.0040.01214.86
5.6.220.0060.01014.46
5.6.210.0070.00714.53
5.6.200.0090.00314.84
5.6.190.0110.00014.71
5.6.180.0100.01015.02
5.6.170.0000.01514.62
5.6.160.0000.01414.91
5.6.150.0090.00314.50
5.6.140.0030.01014.85
5.6.130.0000.01514.71
5.6.120.0000.01214.57
5.6.110.0030.00914.54
5.6.100.0070.01114.64
5.6.90.0060.00914.91
5.6.80.0130.00614.48
5.6.70.0090.00614.62
5.6.60.0030.01514.50
5.6.50.0030.01214.71
5.6.40.0040.01114.59
5.6.30.0090.00914.51
5.6.20.0030.00914.66
5.6.10.0080.00814.77
5.6.00.0060.00614.66

preferences:
35.23 ms | 401 KiB | 5 Q