3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyDateTime extends DateTime { public static function createFromFormat($dformat, $dvalue) { $schedule = $dvalue; $schedule_format = str_replace(array('Y','m','d', 'H', 'i','a'),array('%Y','%m','%d', '%I', '%M', '%p' ) ,$dformat); // %Y, %m and %d correspond to date()'s Y m and d. // %I corresponds to H, %M to i and %p to a $ugly = strptime($schedule, $schedule_format); $ymd = sprintf( // This is a format string that takes six total decimal // arguments, then left-pads them with zeros to either // 4 or 2 characters, as needed '%04d-%02d-%02d %02d:%02d:%02d', $ugly['tm_year'] + 1900, // This will be "111", so we need to add 1900. $ugly['tm_mon'] + 1, // This will be the month minus one, so we add one. $ugly['tm_mday'], $ugly['tm_hour'], $ugly['tm_min'], $ugly['tm_sec'] ); $new_schedule = new MyDateTime($ymd); return $new_schedule; } public function getTimestamp() { return method_exists('DateTime', 'getTimestamp') ? parent::getTimestamp() : $this->format('U'); } } $dateTime = MyDateTime::createFromFormat('d/m/Y', '13/06/2013'); var_dump($dateTime); var_dump($dateTime->format('Y-m-d')); var_dump($dateTime->getTimestamp()); ?>

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.01016.63
8.3.50.0090.00722.83
8.3.40.0070.00718.76
8.3.30.0140.00018.94
8.3.20.0040.00420.34
8.3.10.0050.00221.89
8.3.00.0000.00817.80
8.2.180.0090.00918.29
8.2.170.0070.00722.96
8.2.160.0100.00320.43
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0030.01026.16
8.2.120.0080.00020.61
8.2.110.0030.00620.52
8.2.100.0090.00317.66
8.2.90.0000.00719.09
8.2.80.0000.00817.97
8.2.70.0060.00317.25
8.2.60.0050.00517.79
8.2.50.0040.00818.07
8.2.40.0070.00018.16
8.2.30.0040.00418.01
8.2.20.0000.00817.57
8.2.10.0040.00417.84
8.2.00.0000.00717.57
8.1.280.0070.01025.92
8.1.270.0030.00523.77
8.1.260.0090.00926.35
8.1.250.0000.00728.09
8.1.240.0060.00322.29
8.1.230.0040.00820.88
8.1.220.0000.00818.77
8.1.210.0040.00418.78
8.1.200.0030.00917.11
8.1.190.0050.00317.13
8.1.180.0030.00718.10
8.1.170.0030.00518.57
8.1.160.0000.00721.95
8.1.150.0070.00018.73
8.1.140.0000.00817.29
8.1.130.0000.00717.68
8.1.120.0020.00517.39
8.1.110.0000.00817.31
8.1.100.0070.00017.39
8.1.90.0030.00617.27
8.1.80.0040.00417.34
8.1.70.0030.00317.30
8.1.60.0040.00417.37
8.1.50.0060.00317.44
8.1.40.0050.00217.45
8.1.30.0030.00517.42
8.1.20.0030.00617.46
8.1.10.0000.00717.28
8.1.00.0030.00617.31
8.0.300.0040.00419.77
8.0.290.0030.00616.63
8.0.280.0080.00018.32
8.0.270.0040.00417.13
8.0.260.0030.00317.10
8.0.250.0070.00016.91
8.0.240.0040.00416.89
8.0.230.0070.00016.92
8.0.220.0070.00016.72
8.0.210.0000.00816.86
8.0.200.0030.00316.88
8.0.190.0040.00416.82
8.0.180.0000.00716.84
8.0.170.0040.00416.74
8.0.160.0050.00216.79
8.0.150.0040.00416.72
8.0.140.0040.00416.66
8.0.130.0000.00613.21
8.0.120.0040.00416.78
8.0.110.0000.00716.86
8.0.100.0070.00016.81
8.0.90.0040.00416.80
8.0.80.0140.00316.78
8.0.70.0000.00716.61
8.0.60.0040.00416.79
8.0.50.0070.00016.70
8.0.30.0120.00817.00
8.0.20.0140.00817.40
8.0.10.0070.00016.92
8.0.00.0080.01016.77
7.4.330.0000.00515.00
7.4.320.0040.00416.47
7.4.300.0000.00616.72
7.4.290.0000.00716.65
7.4.280.0030.00516.63
7.4.270.0000.00816.64
7.4.260.0030.00516.63
7.4.250.0000.00816.70
7.4.240.0020.00516.70
7.4.230.0040.00416.73
7.4.220.0110.01116.75
7.4.210.0090.01216.72
7.4.200.0070.00016.77
7.4.160.0130.00316.86
7.4.150.0060.01217.40
7.4.140.0090.00917.86
7.4.130.0090.00916.63
7.4.120.0120.00616.69
7.4.110.0170.00716.61
7.4.100.0140.00816.70
7.4.90.0110.00616.72
7.4.80.0070.01319.39
7.4.70.0090.00916.74
7.4.60.0150.00316.68
7.4.50.0000.00416.78
7.4.40.0060.01116.60
7.4.30.0170.00316.72
7.4.00.0060.01015.09
7.3.330.0000.00613.56
7.3.320.0050.00013.43
7.3.310.0080.00016.42
7.3.300.0000.00716.48
7.3.290.0110.00316.54
7.3.280.0080.01116.61
7.3.270.0120.00617.40
7.3.260.0070.01116.56
7.3.250.0080.01016.56
7.3.240.0120.00916.73
7.3.230.0030.01316.52
7.3.210.0060.01316.51
7.3.200.0060.01219.39
7.3.190.0120.01216.79
7.3.180.0090.00916.62
7.3.170.0090.00616.66
7.3.160.0090.00916.78
7.3.120.0050.01115.15
7.3.110.0080.01115.03
7.3.100.0120.00215.04
7.3.90.0080.00415.05
7.3.80.0090.00514.99
7.3.70.0070.01115.10
7.3.60.0030.00814.96
7.3.50.0070.00615.03
7.3.40.0090.00714.88
7.3.30.0000.01414.97
7.3.20.0030.01016.92
7.3.10.0090.00716.65
7.3.00.0080.00816.56
7.2.330.0090.01216.97
7.2.320.0060.01216.98
7.2.310.0070.01716.93
7.2.300.0120.00616.81
7.2.290.0130.00316.89
7.2.250.0110.00815.23
7.2.240.0050.01515.31
7.2.230.0050.00815.14
7.2.220.0020.01015.10
7.2.210.0040.01115.06
7.2.200.0070.01115.05
7.2.190.0060.00915.19
7.2.180.0090.00415.15
7.2.170.0040.01215.14
7.2.130.0090.01316.77
7.2.120.0110.01016.78
7.2.110.0100.00716.79
7.2.100.0080.00816.62
7.2.90.0130.00616.74
7.2.80.0070.00916.90
7.2.70.0150.00716.72
7.2.60.0060.01016.84
7.2.50.0140.00616.93
7.2.40.0080.00916.80
7.2.30.0050.01216.73
7.2.20.0200.00216.78
7.2.10.0100.01416.79
7.2.00.0090.00916.80
7.1.330.0090.00615.84
7.1.320.0070.00716.00
7.1.310.0090.00416.03
7.1.300.0070.00515.89
7.1.290.0060.00715.89
7.1.280.0070.00815.90
7.1.270.0050.01015.86
7.1.260.0030.00815.89
7.1.250.0130.00615.66
7.1.200.0060.01015.97
7.1.70.0040.00417.46
7.1.60.0040.01219.40
7.1.50.0130.01017.28
7.1.00.0000.08022.42
7.0.200.1770.00715.05
7.0.140.0030.07321.99
7.0.60.0030.04019.95
7.0.50.0100.05717.88
7.0.40.0070.05720.11
7.0.30.0130.04720.28
7.0.20.0230.07320.07
7.0.10.0030.04320.33
7.0.00.0070.04720.09
5.6.280.0100.06720.80
5.6.210.0070.08320.49
5.6.200.0170.05318.24
5.6.190.0070.06320.33
5.6.180.0430.04720.41
5.6.170.0230.08020.44
5.6.160.0130.07020.56
5.6.150.0070.03718.14
5.6.140.0070.03718.24
5.6.130.0070.08318.18
5.6.120.0070.03721.00
5.6.110.0170.08021.14
5.6.100.0070.03721.13
5.6.90.0030.04021.09
5.6.80.0000.05020.39
5.5.350.4270.04320.45
5.5.340.0030.06717.97
5.5.330.0000.09020.21
5.5.320.0130.07320.33
5.5.310.0270.05020.27
5.5.300.0100.05017.97
5.5.290.0170.07017.98
5.5.280.0130.08020.98
5.5.270.0030.08020.81
5.5.260.0130.08320.88
5.5.250.0130.03320.48
5.5.240.0030.09320.37
5.4.450.0830.07019.17
5.4.440.0570.06719.54
5.4.430.0670.05319.32
5.4.420.0770.06319.54
5.4.410.0830.04019.39
5.4.400.0630.06018.96
5.4.390.0800.04019.01
5.4.380.0070.06018.54
5.4.370.0130.04318.44
5.4.360.0170.05318.86
5.4.350.0060.04012.04
5.4.340.0070.04112.04
5.4.320.0050.03612.54
5.4.310.0080.04012.53
5.4.300.0090.04212.54
5.4.290.0090.04612.53
5.4.280.0070.04512.43
5.4.270.0070.05012.43
5.4.260.0050.03812.43
5.4.250.0090.04012.43
5.4.240.0080.03712.43
5.4.230.0070.03712.42
5.4.220.0050.03912.43
5.4.210.0040.04712.42
5.4.200.0100.03912.42
5.4.190.0070.04312.42
5.4.180.0060.04012.42
5.4.170.0090.03812.43
5.4.160.0070.03512.42
5.4.150.0060.04112.42
5.4.140.0070.03712.10
5.4.130.0070.04112.09
5.4.120.0080.03312.05
5.4.110.0060.03612.04
5.4.100.0070.03912.04
5.4.90.0050.03812.04
5.4.80.0050.04012.04
5.4.70.0100.03312.04
5.4.60.0100.03212.04
5.4.50.0060.03712.04
5.4.40.0080.03512.02
5.4.30.0120.04012.02
5.4.20.0070.03912.03
5.4.10.0100.04612.02
5.4.00.0070.03411.52
5.3.290.0060.03812.80
5.3.280.0070.04312.71
5.3.270.0030.04112.72
5.3.260.0080.03912.72
5.3.250.0090.04312.72
5.3.240.0070.04112.72
5.3.230.0060.03912.71
5.3.220.0070.03612.68
5.3.210.0090.03912.68
5.3.200.0090.03712.68
5.3.190.0060.03812.68
5.3.180.0070.03612.68
5.3.170.0050.03812.68
5.3.160.0050.04112.68
5.3.150.0050.03812.68
5.3.140.0050.03812.67
5.3.130.0090.03912.66
5.3.120.0070.03812.66
5.3.110.0050.04012.66
5.3.100.0030.04012.14
5.3.90.0040.03912.12
5.3.80.0040.03712.12
5.3.70.0070.03612.11
5.3.60.0100.03412.10
5.3.50.0080.03412.05
5.3.40.0070.03612.05
5.3.30.0090.03312.02
5.3.20.0050.03711.79
5.3.10.0060.03611.76
5.3.00.0080.03411.74
5.2.170.0050.0299.25
5.2.160.0050.0319.25
5.2.150.0090.0359.25
5.2.140.0070.0319.24
5.2.130.0060.0369.20
5.2.120.0060.0359.21
5.2.110.0040.0399.21
5.2.100.0090.0299.20
5.2.90.0030.0329.20
5.2.80.0050.0329.20
5.2.70.0060.0329.20
5.2.60.0080.0359.15
5.2.50.0060.0379.12
5.2.40.0040.0299.10
5.2.30.0040.0339.07
5.2.20.0090.0319.06
5.2.10.0050.0318.97
5.2.00.0060.0378.83
5.1.60.0060.0318.11
5.1.50.0050.0238.11
5.1.40.0060.0268.07
5.1.30.0040.0268.43
5.1.20.0040.0268.45
5.1.10.0040.0268.18
5.1.00.0050.0248.18
5.0.50.0030.0216.66
5.0.40.0050.0186.52
5.0.30.0040.0306.33
5.0.20.0040.0216.29
5.0.10.0090.0196.28
5.0.00.0060.0346.27
4.4.90.0040.0304.78
4.4.80.0010.0194.75
4.4.70.0020.0244.76
4.4.60.0050.0154.76
4.4.50.0030.0224.77
4.4.40.0020.0304.71
4.4.30.0050.0254.76
4.4.20.0060.0184.84
4.4.10.0050.0144.84
4.4.00.0070.0314.76
4.3.110.0040.0164.67
4.3.100.0050.0154.67
4.3.90.0060.0204.64
4.3.80.0030.0284.58
4.3.70.0030.0154.63
4.3.60.0040.0254.63
4.3.50.0030.0224.63
4.3.40.0040.0254.54
4.3.30.0020.0223.30
4.3.20.0010.0223.27
4.3.10.0030.0253.23
4.3.00.0130.0237.59

preferences:
47.3 ms | 401 KiB | 5 Q