3v4l.org

run code in 300+ PHP versions simultaneously
<?php class WP_JSON_DateTime extends DateTime { /** * Workaround for DateTime::createFromFormat on PHP < 5.3 * Found on http://stackoverflow.com/a/17084893/717643 * * @param string $format The format that the passed in string should be in. * @param string $string String representing the time. * @param DateTimeZone $timezone A DateTimeZone object representing the desired time zone. * @return Datetime */ public static function createFromFormat($format, $time, $timezone = null) { if ( method_exists('DateTime', 'createFromFormat') ) { return parent::createFromFormat($format, $time, $timezone); } return new DateTime(date($format, strtotime($time)), $timezone); } } $timezone = new DateTimeZone('America/Mexico_City'); $date = WP_JSON_DateTime::createFromFormat('Y-m-d H:i:s', '2013-12-14 16:12:03', $timezone); echo $date->format('c'); echo PHP_EOL; echo $date->format('date_tz');

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.0180.00416.63
8.3.50.0100.00817.54
8.3.40.0160.00319.14
8.3.30.0180.00019.04
8.3.20.0080.00018.77
8.3.10.0060.00320.78
8.3.00.0080.00019.50
8.2.180.0230.00017.00
8.2.170.0100.01022.96
8.2.160.0110.00421.20
8.2.150.0070.00024.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0000.00920.76
8.2.110.0110.00021.01
8.2.100.0100.00318.03
8.2.90.0090.00021.21
8.2.80.0050.00319.34
8.2.70.0000.00817.63
8.2.60.0040.00417.93
8.2.50.0040.00418.07
8.2.40.0080.00018.34
8.2.30.0000.00818.09
8.2.20.0050.00217.90
8.2.10.0000.00717.89
8.2.00.0060.00317.77
8.1.280.0070.01025.92
8.1.270.0030.01424.66
8.1.260.0030.00626.35
8.1.250.0000.00828.09
8.1.240.0070.01422.46
8.1.230.0080.00321.04
8.1.220.0040.00417.80
8.1.210.0030.00918.87
8.1.200.0060.00317.35
8.1.190.0040.00417.40
8.1.180.0060.00318.10
8.1.170.0030.00618.78
8.1.160.0040.00418.86
8.1.150.0040.00418.62
8.1.140.0000.00717.53
8.1.130.0030.00517.95
8.1.120.0000.00717.45
8.1.110.0040.00417.53
8.1.100.0040.00417.50
8.1.90.0040.00417.55
8.1.80.0020.00517.47
8.1.70.0060.00317.48
8.1.60.0030.00517.65
8.1.50.0000.00817.49
8.1.40.0000.00817.49
8.1.30.0000.00817.55
8.1.20.0080.00017.62
8.1.10.0030.00617.64
8.1.00.0040.00417.57
8.0.300.0000.00720.03
8.0.290.0000.00717.00
8.0.280.0000.00718.52
8.0.270.0000.00717.23
8.0.260.0000.00717.00
8.0.250.0060.00317.21
8.0.240.0090.00017.14
8.0.230.0030.00617.09
8.0.220.0030.00717.04
8.0.210.0070.00017.02
8.0.200.0070.00317.03
8.0.190.0040.00417.10
8.0.180.0040.00417.07
8.0.170.0000.00917.09
8.0.160.0000.00717.01
8.0.150.0080.00017.07
8.0.140.0110.00216.96
8.0.130.0030.00313.42
8.0.120.0070.00016.89
8.0.110.0000.00716.83
8.0.100.0030.00616.95
8.0.90.0080.00016.95
8.0.80.0080.00817.06
8.0.70.0040.00416.97
8.0.60.0050.00317.03
8.0.50.0040.00416.89
8.0.30.0070.01517.29
8.0.20.0120.01017.23
8.0.10.0000.00717.15
8.0.00.0150.00516.66
7.4.330.0000.00612.94
7.4.320.0000.00616.66
7.4.300.0050.00316.73
7.4.290.0040.00416.59
7.4.280.0030.00616.60
7.4.270.0040.00416.69
7.4.260.0030.00313.26
7.4.250.0080.00016.58
7.4.240.0000.00716.68
7.4.230.0000.00716.51
7.4.220.0060.01016.58
7.4.210.0060.01016.74
7.4.200.0070.00316.65
7.4.190.0030.00516.85
7.4.160.0110.00416.57
7.4.150.0140.00716.79
7.4.140.0050.01316.67
7.4.130.0110.00716.58
7.4.120.0120.00816.69
7.4.110.0090.01416.76
7.4.100.0160.00716.70
7.4.90.0120.00616.84
7.4.80.0090.01219.39
7.4.70.0150.00616.77
7.4.60.0100.00716.78
7.4.50.0070.00316.67
7.4.40.0030.01416.53
7.4.30.0100.01016.59
7.4.00.0100.00715.33
7.3.330.0030.00313.25
7.3.320.0000.00513.34
7.3.310.0060.00316.48
7.3.300.0040.00416.34
7.3.290.0090.00916.34
7.3.280.0080.00916.38
7.3.270.0110.00816.54
7.3.260.0100.00716.32
7.3.250.0070.01216.39
7.3.240.0070.01116.43
7.3.230.0070.01316.32
7.3.210.0120.01016.43
7.3.200.0060.01116.63
7.3.190.0060.01316.49
7.3.180.0110.00716.31
7.3.170.0070.01016.30
7.3.160.0110.00416.54
7.3.120.0070.00714.95
7.3.10.0150.00616.36
7.3.00.0170.00016.16
7.2.330.0120.00616.63
7.2.320.0070.01416.90
7.2.310.0060.01616.86
7.2.300.0030.01416.89
7.2.290.0100.00616.81
7.2.130.0090.00616.44
7.2.120.0070.01116.90
7.2.110.0220.00716.40
7.2.100.0160.00816.31
7.2.90.0210.01216.45
7.2.80.0170.00316.66
7.2.70.0340.00716.57
7.2.60.0360.00716.62
7.2.50.0330.00816.52
7.2.40.0460.00716.62
7.2.30.0510.01317.00
7.2.20.0430.01116.56
7.2.10.0370.01717.23
7.2.00.0140.00617.87
7.1.250.0160.00915.54
7.1.100.0000.01617.87
7.1.70.0000.00817.10
7.1.60.0130.01319.40
7.1.50.0040.01517.24
7.1.00.0000.03722.48
7.0.200.0000.00917.03
7.0.140.0030.07322.23
7.0.120.0070.07022.16
7.0.100.0100.03320.08
7.0.90.0030.08319.95
7.0.80.0170.07019.93
7.0.70.0030.08319.88
7.0.60.0070.08020.01
7.0.50.0100.06020.27
7.0.40.0030.08320.16
7.0.30.0030.09020.08
7.0.20.0130.05320.13
7.0.10.0000.05019.95
7.0.00.0000.09320.10
5.6.280.0070.07021.05
5.6.250.0030.04720.67
5.6.240.0030.04020.67
5.6.230.0200.04720.68
5.6.220.0170.06720.54
5.6.210.0000.09320.69
5.6.200.0100.08320.95
5.6.190.0000.07021.06
5.6.180.0100.05021.19
5.6.170.0100.03720.93
5.6.160.0070.04721.09
5.6.150.0100.08021.05
5.6.140.0000.08721.18
5.6.130.0070.08720.96
5.6.120.0070.08321.02
5.6.110.0070.05721.04
5.6.100.0000.05721.13
5.6.90.0070.08721.00
5.6.80.0070.04320.47
5.6.70.0030.07720.44
5.6.60.0130.07020.44
5.6.50.0100.07020.43
5.6.40.0130.06320.42
5.6.30.0170.07320.51
5.6.20.0070.05720.40
5.6.10.0100.05020.37
5.6.00.0100.05720.33
5.5.380.0030.04720.41
5.5.370.0100.05320.37
5.5.360.0130.07320.45
5.5.350.0170.07720.39
5.5.340.0030.08720.94
5.5.330.0130.07020.80
5.5.320.0070.08020.81
5.5.310.0100.03320.91
5.5.300.0070.08320.79
5.5.290.0030.08020.73
5.5.280.0070.04320.74
5.5.270.0130.07320.83
5.5.260.0070.08720.89
5.5.250.0070.08020.71
5.5.240.0200.07020.04
5.5.230.0070.08020.18
5.5.220.0030.08020.21
5.5.210.0030.06020.03
5.5.200.0130.06720.00
5.5.190.0100.07020.19
5.5.180.0030.05320.29
5.5.160.0100.07320.21
5.5.150.0070.08020.26
5.5.140.0070.07720.15
5.5.130.0100.06020.26
5.5.120.0030.06320.15
5.5.110.0100.07320.18
5.5.100.0070.05320.11
5.5.90.0100.07319.95
5.5.80.0070.03720.16
5.5.70.0100.03020.07
5.5.60.0030.07020.01
5.5.50.0030.03320.07
5.5.40.0030.07020.07
5.5.30.0030.07720.06
5.5.20.0070.04719.96
5.5.10.0100.03020.07
5.5.00.0070.04319.97
5.4.450.0030.08019.23
5.4.440.0070.06719.23
5.4.430.0030.04719.44
5.4.420.0170.06719.55
5.4.410.0070.08319.43
5.4.400.0000.08019.05
5.4.390.0000.08319.13
5.4.380.0070.06318.87
5.4.370.0070.07719.12
5.4.360.0070.05019.16
5.4.350.0030.04719.04
5.4.340.0100.06719.04
5.4.320.0030.05019.23
5.4.310.0070.08019.04
5.4.300.0030.07719.12
5.4.290.0100.07019.13
5.4.280.0030.07318.89
5.4.270.0030.08319.08
5.4.260.0070.06019.17
5.4.250.0100.07019.02
5.4.240.0070.06018.90
5.4.230.0070.07319.11
5.4.220.0030.08319.04
5.4.210.0100.07018.87
5.4.200.0100.06718.93
5.4.190.0000.04018.93
5.4.180.0070.03019.20
5.4.170.0000.08319.13
5.4.160.0070.06019.18
5.4.150.0170.07019.01
5.4.140.0070.03716.47
5.4.130.0030.04016.38
5.4.120.0070.04016.49
5.4.110.0100.05316.55
5.4.100.0030.07316.56
5.4.90.0000.05716.52
5.4.80.0100.05716.54
5.4.70.0170.06316.50
5.4.60.0130.06316.34
5.4.50.0000.05716.45
5.4.40.0070.06716.46
5.4.30.0030.06716.24
5.4.20.0030.07716.44
5.4.10.0200.06016.32
5.4.00.0130.06715.86
5.3.290.0030.07714.70
5.3.280.0100.07714.74
5.3.270.0030.03314.67
5.3.260.0100.04314.67
5.3.250.0130.03314.62
5.3.240.0070.04314.67
5.3.230.0070.07714.69
5.3.220.0170.05314.52
5.3.210.0070.06314.59
5.3.200.0100.06714.54
5.3.190.0000.04014.68
5.3.180.0030.06714.50
5.3.170.0070.03714.52
5.3.160.0000.05314.54
5.3.150.0130.07014.56
5.3.140.0100.07314.57
5.3.130.0030.06014.48
5.3.120.0070.06014.57
5.3.110.0100.05314.53
5.3.100.0030.06014.10
5.3.90.0070.07014.16
5.3.80.0070.06713.93
5.3.70.0070.04314.04
5.3.60.0070.05014.00
5.3.50.0130.06714.01
5.3.40.0100.07014.04
5.3.30.0030.04313.93
5.3.20.0130.04313.59
5.3.10.0100.03313.78
5.3.00.0070.07013.62
5.2.170.0030.06311.16
5.2.160.0000.06311.18
5.2.150.0100.05311.20
5.2.140.0070.07011.28
5.2.130.0030.03311.11
5.2.120.0100.05311.15
5.2.110.0070.06011.19
5.2.100.0100.05011.17
5.2.90.0070.06311.14
5.2.80.0030.04711.18
5.2.70.0000.05711.13
5.2.60.0000.06711.16
5.2.50.0030.06311.16
5.2.40.0070.05010.93
5.2.30.0030.04311.04
5.2.20.0030.03710.82
5.2.10.0000.04710.78
5.2.00.0030.03310.71
5.1.60.0070.05010.30
5.1.50.0030.05310.30
5.1.40.0100.04710.30
5.1.30.0100.05310.33
5.1.20.0070.03710.45
5.1.10.0200.02710.30
5.1.00.0130.03310.30
5.0.50.0000.03310.30
5.0.40.0030.04310.30
5.0.30.0030.06310.30
5.0.20.0030.04310.30
5.0.10.0000.05010.30
5.0.00.0030.03310.30
4.4.90.0070.03310.30
4.4.80.0000.03010.30
4.4.70.0000.03710.30
4.4.60.0100.02710.30
4.4.50.0000.03710.30
4.4.40.0030.04310.30
4.4.30.0070.01010.30
4.4.20.0070.02010.30
4.4.10.0000.03010.30
4.4.00.0030.04710.30
4.3.110.0000.04710.30
4.3.100.0000.03710.30
4.3.90.0000.03310.30
4.3.80.0070.05010.30
4.3.70.0000.03710.30
4.3.60.0000.02310.30
4.3.50.0030.01710.30
4.3.40.0000.04310.30
4.3.30.0000.02310.30
4.3.20.0030.03310.30
4.3.10.0000.02310.30
4.3.00.0000.02310.30

preferences:
45.34 ms | 401 KiB | 5 Q