3v4l.org

run code in 300+ PHP versions simultaneously
<?php class WP_JSON_DateTime extends DateTime { /** * Workaround for DateTime::createFromFormat on PHP > 5.2 * 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.0100.01018.43
8.3.50.0120.00521.21
8.3.40.0070.00719.09
8.3.30.0070.00720.18
8.3.20.0090.00020.30
8.3.10.0030.00521.75
8.3.00.0040.00422.39
8.2.180.0110.00416.50
8.2.170.0090.00622.96
8.2.160.0030.01020.52
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0090.00926.16
8.2.120.0080.00019.69
8.2.110.0090.00022.18
8.2.100.0110.00019.33
8.2.90.0040.00419.22
8.2.80.0000.00819.32
8.2.70.0060.00317.63
8.2.60.0030.00518.05
8.2.50.0030.00518.07
8.2.40.0060.00318.34
8.2.30.0060.00318.20
8.2.20.0040.00417.86
8.2.10.0000.00717.84
8.2.00.0070.00417.76
8.1.280.0110.00325.92
8.1.270.0000.00724.66
8.1.260.0050.00326.35
8.1.250.0050.00328.09
8.1.240.0030.00623.95
8.1.230.0030.00819.04
8.1.220.0050.00317.77
8.1.210.0050.00318.77
8.1.200.0090.00017.47
8.1.190.0030.00517.53
8.1.180.0040.00420.07
8.1.170.0040.00418.53
8.1.160.0040.00422.20
8.1.150.0040.00418.62
8.1.140.0000.00717.45
8.1.130.0000.00817.82
8.1.120.0000.00817.56
8.1.110.0040.00417.41
8.1.100.0040.00417.56
8.1.90.0040.00417.50
8.1.80.0040.00417.43
8.1.70.0070.00017.37
8.1.60.0000.00817.64
8.1.50.0020.00517.48
8.1.40.0030.00517.61
8.1.30.0000.00817.60
8.1.20.0040.00417.70
8.1.10.0080.00017.68
8.1.00.0000.00717.62
8.0.300.0070.00018.77
8.0.290.0040.00417.05
8.0.280.0030.00318.48
8.0.270.0040.00417.33
8.0.260.0000.00716.93
8.0.250.0030.00317.13
8.0.240.0030.00517.05
8.0.230.0070.00016.92
8.0.220.0030.00517.05
8.0.210.0000.00716.91
8.0.200.0000.00617.05
8.0.190.0030.00516.95
8.0.180.0000.00717.07
8.0.170.0000.00817.04
8.0.160.0030.00317.08
8.0.150.0000.00716.99
8.0.140.0000.00817.02
8.0.130.0030.00313.41
8.0.120.0060.00317.00
8.0.110.0070.00016.87
8.0.100.0050.00317.10
8.0.90.0000.00716.82
8.0.80.0000.01417.00
8.0.70.0080.00016.92
8.0.60.0000.00716.96
8.0.50.0000.00716.98
8.0.30.0130.00617.21
8.0.20.0140.00417.45
8.0.10.0040.00417.09
8.0.00.0100.01117.07
7.4.330.0020.00215.00
7.4.320.0030.00316.60
7.4.300.0060.00016.64
7.4.290.0030.00316.60
7.4.280.0030.00316.57
7.4.270.0020.00516.52
7.4.260.0030.00316.57
7.4.250.0040.00416.54
7.4.240.0030.00316.49
7.4.230.0030.00316.61
7.4.220.0140.00616.51
7.4.210.0050.00816.65
7.4.200.0000.00716.59
7.4.190.0080.00016.66
7.4.160.0140.00416.70
7.4.150.0120.00617.40
7.4.140.0130.00717.86
7.4.130.0090.01116.57
7.4.120.0120.00416.54
7.4.110.0110.00716.55
7.4.100.0060.01216.55
7.4.90.0100.00716.64
7.4.80.0040.01619.39
7.4.70.0060.01516.65
7.4.60.0070.01016.55
7.4.50.0000.00716.75
7.4.40.0120.00022.77
7.4.30.0060.01416.82
7.4.00.0100.00815.09
7.3.330.0050.00013.38
7.3.320.0000.00613.20
7.3.310.0000.00816.27
7.3.300.0030.00316.40
7.3.290.0000.01416.39
7.3.280.0060.01016.37
7.3.270.0070.01017.40
7.3.260.0130.00716.37
7.3.250.0100.00716.46
7.3.240.0070.01016.61
7.3.230.0090.00916.61
7.3.210.0120.00416.57
7.3.200.0070.01019.39
7.3.190.0140.01016.55
7.3.180.0140.00716.43
7.3.170.0030.01316.29
7.3.160.0060.00916.46
7.3.120.0080.01014.96
7.3.110.0060.01215.07
7.3.100.0040.01114.98
7.3.90.0150.00014.88
7.3.80.0030.01014.95
7.3.70.0060.00314.88
7.3.60.0070.00714.80
7.3.50.0000.01214.56
7.3.40.0070.00714.90
7.3.30.0030.00914.79
7.3.20.0060.00616.68
7.3.10.0060.00916.43
7.3.00.0140.00016.40
7.2.330.0090.01316.89
7.2.320.0040.01616.52
7.2.310.0070.01116.96
7.2.300.0060.01216.94
7.2.290.0100.00916.71
7.2.250.0060.01215.26
7.2.240.0070.01314.86
7.2.230.0030.01315.10
7.2.220.0070.01015.15
7.2.210.0060.00915.06
7.2.200.0090.00314.94
7.2.190.0030.00715.21
7.2.180.0100.00714.89
7.2.170.0090.00615.25
7.2.60.0080.00816.98
7.1.330.0080.00415.96
7.1.320.0110.00315.75
7.1.310.0030.01315.75
7.1.300.0000.00915.90
7.1.290.0120.00315.91
7.1.280.0100.00015.96
7.1.270.0060.00615.97
7.1.260.0060.00316.00
7.1.200.0000.01215.81
7.1.70.0070.00717.25
7.1.60.0060.01919.29
7.1.50.0000.01017.23
7.1.00.0000.05022.32
7.0.200.0580.01314.79
7.0.140.0000.07322.13
7.0.90.0070.07721.85
7.0.80.0070.07021.73
7.0.70.0070.07021.80
7.0.60.0000.05321.75
7.0.50.0000.08722.09
7.0.40.0030.07019.94
7.0.30.0000.08320.10
7.0.20.0100.08020.18
7.0.10.0030.08320.00
7.0.00.0070.08320.18
5.6.280.0000.07321.16
5.6.240.0130.07320.65
5.6.230.0070.07320.64
5.6.220.0030.07720.71
5.6.210.0000.08020.50
5.6.200.0100.07721.08
5.6.190.0030.08321.04
5.6.180.0100.07721.09
5.6.170.0070.07021.05
5.6.160.0030.06321.10
5.6.150.0000.08321.18
5.6.140.0100.08021.02
5.6.130.0000.04721.11
5.6.120.0030.09021.06
5.6.110.0030.05321.11
5.6.100.0030.08721.02
5.6.90.0070.05721.04
5.6.80.0030.06320.40
5.6.70.0070.05720.52
5.6.60.0070.08320.55
5.6.50.0100.07020.45
5.6.40.0130.04020.45
5.6.30.0100.08020.32
5.6.20.0100.08020.47
5.6.10.0030.04720.41
5.6.00.0070.07320.29
5.5.380.0000.04020.43
5.5.370.0000.07020.37
5.5.360.0070.05320.36
5.5.350.0130.05720.43
5.5.340.0030.07720.93
5.5.330.0030.08320.82
5.5.320.0100.03020.77
5.5.310.0070.03720.89
5.5.300.0070.08320.75
5.5.290.0070.06020.74
5.5.280.0100.07720.65
5.5.270.0030.09020.76
5.5.260.0100.07320.88
5.5.250.0100.07720.68
5.5.240.0000.05320.25
5.5.230.0030.05320.24
5.5.220.0070.07020.11
5.5.210.0070.08320.30
5.5.200.0070.07720.29
5.5.190.0070.08020.20
5.5.180.0070.07320.27
5.5.160.0030.07320.20
5.5.150.0070.08020.20
5.5.140.0030.07020.08
5.5.130.0000.09720.18
5.5.120.0030.08020.22
5.5.110.0070.08320.26
5.5.100.0030.06719.96
5.5.90.0100.04320.07
5.5.80.0100.06320.13
5.5.70.0030.08020.07
5.5.60.0070.06720.09
5.5.50.0070.04020.11
5.5.40.0000.06320.16
5.5.30.0070.04319.94
5.5.20.0030.04720.09
5.5.10.0070.04320.12
5.5.00.0000.07320.04
5.4.450.0100.08019.54
5.4.440.0070.08019.38
5.4.430.0100.06719.50
5.4.420.0130.06719.48
5.4.410.0070.07319.38
5.4.400.0030.07019.21
5.4.390.0030.05018.88
5.4.380.0100.05719.23
5.4.370.0030.07319.14
5.4.360.0100.06719.04
5.4.350.0070.06319.11
5.4.340.0130.04719.04
5.4.320.0030.07719.05
5.4.310.0030.08019.18
5.4.300.0030.08019.13
5.4.290.0030.06319.06
5.4.280.0070.08319.16
5.4.270.0000.05719.18
5.4.260.0070.07719.14
5.4.250.0070.07319.04
5.4.240.0030.07718.93
5.4.230.0100.07019.09
5.4.220.0000.04719.22
5.4.210.0070.06319.08
5.4.200.0030.04318.87
5.4.190.0030.04019.24
5.4.180.0100.06718.93
5.4.170.0070.04719.13
5.4.160.0030.07319.10
5.4.150.0070.07318.82
5.4.140.0030.07016.48
5.4.130.0000.07716.45
5.4.120.0070.06316.44
5.4.110.0000.03716.54
5.4.100.0030.03016.40
5.4.90.0000.04316.48
5.4.80.0070.06716.54
5.4.70.0000.07316.38
5.4.60.0030.06016.40
5.4.50.0070.07016.45
5.4.40.0130.05016.49
5.4.30.0130.06716.46
5.4.20.0130.03316.49
5.4.10.0070.04016.37
5.4.00.0030.07015.93
5.3.290.0030.08014.65
5.3.280.0030.04314.57
5.3.270.0000.07014.72
5.3.260.0030.05314.54
5.3.250.0070.07314.57
5.3.240.0000.08014.66
5.3.230.0000.04014.61
5.3.220.0000.04714.64
5.3.210.0030.07714.66
5.3.200.0030.06714.62
5.3.190.0000.07714.60
5.3.180.0000.05014.62
5.3.170.0070.07714.60
5.3.160.0130.06714.50
5.3.150.0070.06714.66
5.3.140.0030.05314.67
5.3.130.0030.07314.66
5.3.120.0030.06314.53
5.3.110.0130.06014.58
5.3.100.0100.06314.07
5.3.90.0070.06714.04
5.3.80.0000.06714.05
5.3.70.0130.05014.04
5.3.60.0000.04014.04
5.3.50.0030.03713.97
5.3.40.0030.03713.96
5.3.30.0030.04013.97
5.3.20.0070.05013.73
5.3.10.0070.03013.72
5.3.00.0070.03313.63
5.2.170.0000.03011.20
5.2.160.0000.03311.21
5.2.150.0030.03311.21
5.2.140.0000.03011.16
5.2.130.0000.03011.03
5.2.120.0000.03011.25
5.2.110.0030.02711.22
5.2.100.0030.03711.01
5.2.90.0000.03011.19
5.2.80.0070.02311.01
5.2.70.0000.04311.08
5.2.60.0070.02011.14
5.2.50.0030.04711.09
5.2.40.0030.02711.02
5.2.30.0000.04311.03
5.2.20.0030.02711.08
5.2.10.0000.04010.97
5.2.00.0070.02310.84
5.1.60.0030.05010.32
5.1.50.0030.02710.32
5.1.40.0000.02310.32
5.1.30.0000.02710.32
5.1.20.0030.02010.32
5.1.10.0070.05010.32
5.1.00.0000.02310.32
5.0.50.0000.03010.32
5.0.40.0030.01310.32
5.0.30.0030.02710.32
5.0.20.0030.02010.32
5.0.10.0030.02010.32
5.0.00.0000.03010.32
4.4.90.0030.03310.32
4.4.80.0070.01310.32
4.4.70.0000.01710.32
4.4.60.0030.01310.32
4.4.50.0000.02310.32
4.4.40.0000.02310.32
4.4.30.0030.01310.32
4.4.20.0000.02710.32
4.4.10.0000.03710.32
4.4.00.0070.04710.32
4.3.110.0000.01310.32
4.3.100.0000.02710.32
4.3.90.0030.02310.32
4.3.80.0000.03010.32
4.3.70.0030.01010.32
4.3.60.0000.01310.32
4.3.50.0000.01310.32
4.3.40.0000.02710.32
4.3.30.0000.01310.32
4.3.20.0000.03310.32
4.3.10.0000.01710.32
4.3.00.0000.02010.32

preferences:
43.95 ms | 401 KiB | 5 Q