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 '<br>'; 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.0110.00718.80
8.3.50.0060.01121.26
8.3.40.0110.00418.72
8.3.30.0070.00720.34
8.3.20.0080.00020.34
8.3.10.0080.00022.02
8.3.00.0040.00422.39
8.2.180.0090.00618.41
8.2.170.0110.00422.96
8.2.160.0120.00620.57
8.2.150.0040.00424.18
8.2.140.0190.00024.66
8.2.130.0140.00026.16
8.2.120.0040.00419.73
8.2.110.0060.00322.21
8.2.100.0040.00819.25
8.2.90.0040.00419.21
8.2.80.0080.00019.09
8.2.70.0000.00817.63
8.2.60.0030.00518.05
8.2.50.0050.00318.07
8.2.40.0050.00318.22
8.2.30.0050.00218.14
8.2.20.0000.00817.74
8.2.10.0060.00317.81
8.2.00.0000.00917.93
8.1.280.0150.00425.92
8.1.270.0000.00824.66
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00623.79
8.1.230.0060.00619.16
8.1.220.0040.00417.78
8.1.210.0000.00918.77
8.1.200.0060.00317.25
8.1.190.0040.00417.65
8.1.180.0030.00519.13
8.1.170.0050.00318.47
8.1.160.0000.00822.05
8.1.150.0050.00218.70
8.1.140.0040.00417.49
8.1.130.0030.00317.86
8.1.120.0000.00817.53
8.1.110.0040.00417.51
8.1.100.0070.00017.52
8.1.90.0000.00717.49
8.1.80.0040.00417.52
8.1.70.0070.00017.43
8.1.60.0030.00617.68
8.1.50.0040.00417.58
8.1.40.0000.00717.50
8.1.30.0000.00717.76
8.1.20.0030.00617.79
8.1.10.0030.00517.68
8.1.00.0040.00417.54
8.0.300.0040.00718.77
8.0.290.0030.00517.05
8.0.280.0000.00818.58
8.0.270.0080.00017.17
8.0.260.0000.00817.01
8.0.250.0000.00717.16
8.0.240.0030.00517.04
8.0.230.0000.00717.04
8.0.220.0000.00716.90
8.0.210.0030.00317.03
8.0.200.0040.00417.08
8.0.190.0060.00317.07
8.0.180.0020.00517.06
8.0.170.0050.00316.96
8.0.160.0050.00316.90
8.0.150.0000.00716.98
8.0.140.0000.00716.86
8.0.130.0000.00513.43
8.0.120.0040.00417.02
8.0.110.0050.00217.01
8.0.100.0040.00416.89
8.0.90.0040.00417.10
8.0.80.0060.01217.02
8.0.70.0000.00716.98
8.0.60.0040.00417.19
8.0.50.0050.00317.04
8.0.30.0160.00617.31
8.0.20.0110.01117.40
8.0.10.0040.00417.14
8.0.00.0130.00516.80
7.4.330.0050.00015.00
7.4.320.0000.00716.66
7.4.300.0000.00716.58
7.4.290.0030.00316.59
7.4.280.0040.00416.47
7.4.270.0000.00716.69
7.4.260.0080.00016.43
7.4.250.0000.00716.55
7.4.240.0030.00416.60
7.4.230.0060.00016.38
7.4.220.0110.00716.61
7.4.210.0050.01116.57
7.4.200.0070.00016.56
7.4.190.0030.00316.82
7.4.160.0090.00616.50
7.4.150.0090.00817.40
7.4.140.0070.01117.86
7.4.130.0100.00816.54
7.4.120.0120.00716.56
7.4.110.0100.00716.48
7.4.100.0060.01216.50
7.4.90.0060.01216.59
7.4.80.0070.01119.39
7.4.70.0110.00616.93
7.4.60.0100.00716.64
7.4.50.0040.00416.43
7.4.40.0000.01322.77
7.4.30.0070.01016.44
7.4.00.0060.01215.07
7.3.330.0000.00513.38
7.3.320.0000.00513.18
7.3.310.0000.00716.28
7.3.300.0030.00316.24
7.3.290.0040.01116.45
7.3.280.0070.00916.37
7.3.270.0080.01217.40
7.3.260.0040.01516.48
7.3.250.0040.01416.54
7.3.240.0070.01016.46
7.3.230.0080.00816.60
7.3.210.0080.00816.48
7.3.200.0150.00619.39
7.3.190.0060.01516.61
7.3.180.0000.01516.52
7.3.170.0070.01016.43
7.3.160.0040.01116.43
7.3.120.0050.01114.80
7.3.110.0030.01414.85
7.3.100.0060.00314.96
7.3.90.0060.00914.96
7.3.80.0040.01115.00
7.3.70.0140.00315.01
7.3.60.0060.00615.07
7.3.50.0030.01314.77
7.3.40.0070.00714.55
7.3.30.0080.00414.90
7.3.20.0110.00416.91
7.3.10.0070.01016.48
7.3.00.0030.00616.59
7.2.330.0110.00716.55
7.2.320.0110.00816.44
7.2.310.0070.01016.88
7.2.300.0100.00716.86
7.2.290.0100.01017.02
7.2.250.0100.01015.07
7.2.240.0070.01314.80
7.2.230.0130.00014.94
7.2.220.0000.01615.08
7.2.210.0070.01014.69
7.2.200.0070.01415.28
7.2.190.0040.00915.27
7.2.180.0100.00715.16
7.2.170.0070.00715.06
7.2.00.0000.01319.51
7.1.330.0000.01215.79
7.1.320.0030.00915.65
7.1.310.0030.01215.80
7.1.300.0030.00615.75
7.1.290.0060.00315.81
7.1.280.0000.00915.93
7.1.270.0030.01415.94
7.1.260.0030.01315.95
7.1.100.0170.00718.04
7.1.70.0060.00317.35
7.1.60.0040.01117.35
7.1.50.0060.01616.82
7.1.00.0000.08022.32
7.0.200.0060.01016.62
7.0.140.0030.07721.95
7.0.110.0530.06719.89
7.0.100.0570.02320.10
7.0.90.0430.07319.96
7.0.80.0430.08319.95
7.0.70.0500.07019.94
7.0.60.0470.08020.00
7.0.50.0600.07320.05
7.0.40.0100.07019.73
7.0.30.0000.04319.82
7.0.20.0030.08319.68
7.0.10.0070.08019.87
7.0.00.0000.04319.75
5.6.280.0000.07721.04
5.6.260.0000.05720.68
5.6.250.0070.08320.60
5.6.240.0070.07720.68
5.6.230.0030.07720.67
5.6.220.0070.03720.67
5.6.210.0070.08020.57
5.6.200.0100.07720.63
5.6.190.0030.08020.69
5.6.180.0030.05020.62
5.6.170.0130.07020.57
5.6.160.0030.07320.58
5.6.150.0030.08020.70
5.6.140.0100.07720.67
5.6.130.0100.04020.70
5.6.120.0030.08720.56
5.6.110.0030.08320.62
5.6.100.0130.07720.64
5.6.90.0130.07320.68
5.6.80.0070.03719.95
5.6.70.0100.07019.94
5.6.60.0170.06320.06
5.6.50.0100.07720.09
5.6.40.0030.04719.96
5.6.30.0000.08319.98
5.6.20.0030.04319.92
5.6.10.0070.04319.92
5.6.00.0030.07720.01
5.5.380.0030.08017.61
5.5.370.0070.07017.61
5.5.360.0030.07017.63
5.5.350.0070.07017.62
5.5.340.0070.07317.96
5.5.330.0100.08017.91
5.5.320.0100.04718.25
5.5.310.0030.08318.10
5.5.300.0000.08018.10
5.5.290.0100.07718.23
5.5.280.0100.07318.08
5.5.270.0100.07318.25
5.5.260.0100.07718.12
5.5.250.0030.08017.86
5.5.240.0100.06717.46
5.5.230.0070.05017.63
5.5.220.0130.07317.50
5.5.210.0030.07017.64
5.5.200.0100.04317.18
5.5.190.0130.05317.18
5.5.180.0070.06317.26
5.5.160.0000.08317.48
5.5.150.0070.07317.28
5.5.140.0130.05717.44
5.5.130.0100.07017.25
5.5.120.0070.07717.60
5.5.110.0030.07317.56
5.5.100.0030.05017.18
5.5.90.0070.07317.35
5.5.80.0000.07317.35
5.5.70.0030.07317.36
5.5.60.0070.03317.34
5.5.50.0000.04017.46
5.5.40.0100.05717.17
5.5.30.0030.03717.36
5.5.20.0100.06717.36
5.5.10.0070.05017.15
5.5.00.0100.08317.46
5.4.450.0130.07319.56
5.4.440.0100.07319.55
5.4.430.0000.04019.50
5.4.420.0070.07719.48
5.4.410.0070.07319.43
5.4.400.0030.05319.32
5.4.390.0100.06319.11
5.4.380.0070.05719.18
5.4.370.0070.06318.98
5.4.360.0030.08719.00
5.4.350.0030.04719.23
5.4.340.0030.04018.96
5.4.320.0000.08019.18
5.4.310.0030.05319.18
5.4.300.0100.07319.03
5.4.290.0100.07319.20
5.4.280.0030.05019.24
5.4.270.0130.07319.20
5.4.260.0130.07019.00
5.4.250.0030.04319.00
5.4.240.0070.06719.17
5.4.230.0000.04719.16
5.4.220.0030.03719.13
5.4.210.0100.06719.01
5.4.200.0070.05019.22
5.4.190.0030.03719.33
5.4.180.0000.04018.99
5.4.170.0100.05319.16
5.4.160.0070.07319.22
5.4.150.0000.08719.14
5.4.140.0100.06716.57
5.4.130.0030.06716.56
5.4.120.0100.05316.64
5.4.110.0070.07316.52
5.4.100.0070.06716.56
5.4.90.0130.06016.37
5.4.80.0000.08016.60
5.4.70.0070.05016.61
5.4.60.0070.07316.49
5.4.50.0100.06716.33
5.4.40.0100.05316.59
5.4.30.0070.05316.51
5.4.20.0070.07316.34
5.4.10.0000.07716.63
5.4.00.0100.02716.07
5.3.290.0100.07014.80
5.3.280.0000.04014.68
5.3.270.0070.03314.65
5.3.260.0000.08014.64
5.3.250.0100.07314.70
5.3.240.0100.07714.63
5.3.230.0100.06314.69
5.3.220.0030.07714.53
5.3.210.0030.05714.59
5.3.200.0100.06714.58
5.3.190.0030.08714.71
5.3.180.0070.07314.56
5.3.170.0070.04014.59
5.3.160.0070.03714.80
5.3.150.0030.07014.71
5.3.140.0030.05314.61
5.3.130.0030.08014.57
5.3.120.0000.04314.68
5.3.110.0070.05714.66
5.3.100.0030.07714.02
5.3.90.0070.03714.16
5.3.80.0000.08014.16
5.3.70.0070.06014.03
5.3.60.0030.06714.15
5.3.50.0030.05713.91
5.3.40.0030.07313.99
5.3.30.0100.06313.88
5.3.20.0000.05313.84
5.3.10.0100.02713.68
5.3.00.0030.06313.63
5.2.170.0070.05012.95
5.2.160.0030.05012.95
5.2.150.0000.03012.95
5.2.140.0000.06712.95
5.2.130.0070.05712.95
5.2.120.0030.06012.95
5.2.110.0130.05712.95
5.2.100.0000.06012.95
5.2.90.0030.06012.95
5.2.80.0070.05312.95
5.2.70.0030.06012.95
5.2.60.0030.06012.95
5.2.50.0030.05312.95
5.2.40.0030.04712.95
5.2.30.0030.03012.95
5.2.20.0070.06012.95
5.2.10.0170.04312.95
5.2.00.0070.05012.95
5.1.60.0030.02312.95
5.1.50.0000.02312.95
5.1.40.0030.05312.95
5.1.30.0000.03012.95
5.1.20.0100.05312.95
5.1.10.0000.05012.95
5.1.00.0130.04712.95
5.0.50.0000.02312.95
5.0.40.0070.04012.95
5.0.30.0000.06712.95
5.0.20.0100.02712.95
5.0.10.0030.04312.95
5.0.00.0030.04712.95
4.4.90.0000.02012.95
4.4.80.0000.03712.95
4.4.70.0000.03712.95
4.4.60.0000.03312.95
4.4.50.0000.03712.95
4.4.40.0030.05012.95
4.4.30.0000.03712.95
4.4.20.0000.03712.95
4.4.10.0000.03712.95
4.4.00.0000.04712.95
4.3.110.0070.03012.95
4.3.100.0000.03712.95
4.3.90.0000.03712.95
4.3.80.0100.04712.95
4.3.70.0000.03712.95
4.3.60.0000.03712.95
4.3.50.0070.02712.95
4.3.40.0000.05312.95
4.3.30.0030.03012.95
4.3.20.0070.01312.95
4.3.10.0000.02012.95
4.3.00.0030.03312.95

preferences:
47.24 ms | 401 KiB | 5 Q