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 DateTime($ymd); return $new_schedule; } } $dateTime = MyDateTime::createFromFormat('d/m/Y', '13/06/2013'); var_dump($dateTime); var_dump($dateTime->format('Y-m-d')); var_dump($dateTime->format('U'));

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.70.0110.01116.63
8.3.60.0140.00416.37
8.3.50.0110.00822.88
8.3.40.0040.01818.73
8.3.30.0060.00919.09
8.3.20.0070.00020.30
8.3.10.0000.00821.60
8.3.00.0080.00017.68
8.2.180.0000.01816.63
8.2.170.0120.00922.96
8.2.160.0030.01020.53
8.2.150.0040.00424.18
8.2.140.0080.01124.66
8.2.130.0070.00026.16
8.2.120.0070.00720.82
8.2.110.0090.00022.21
8.2.100.0080.00318.03
8.2.90.0000.00718.92
8.2.80.0000.00817.97
8.2.70.0090.00017.50
8.2.60.0040.00417.80
8.2.50.0060.00318.07
8.2.40.0070.00018.09
8.2.30.0070.00018.00
8.2.20.0050.00317.56
8.2.10.0050.00217.85
8.2.00.0050.00317.55
8.1.280.0120.00625.92
8.1.270.0050.00323.75
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0060.00321.99
8.1.230.0060.00619.15
8.1.220.0000.00817.74
8.1.210.0030.00518.77
8.1.200.0050.00517.23
8.1.190.0040.00416.88
8.1.180.0040.00418.10
8.1.170.0000.00918.59
8.1.160.0000.00822.02
8.1.150.0040.00418.82
8.1.140.0000.00817.37
8.1.130.0040.00417.83
8.1.120.0040.00417.31
8.1.110.0040.00417.35
8.1.100.0040.00417.32
8.1.90.0030.00517.38
8.1.80.0080.00017.31
8.1.70.0030.00317.27
8.1.60.0000.00817.43
8.1.50.0000.00817.40
8.1.40.0030.00517.41
8.1.30.0000.00817.45
8.1.20.0040.00417.53
8.1.10.0040.00417.34
8.1.00.0050.00217.22
8.0.300.0070.00018.77
8.0.290.0000.00716.58
8.0.280.0070.00018.38
8.0.270.0030.00517.05
8.0.260.0040.00417.10
8.0.250.0030.00316.93
8.0.240.0090.00016.85
8.0.230.0030.00316.79
8.0.220.0070.00016.75
8.0.210.0000.00716.84
8.0.200.0030.00316.79
8.0.190.0040.00416.90
8.0.180.0050.00216.90
8.0.170.0040.00416.89
8.0.160.0030.00316.80
8.0.150.0000.00816.73
8.0.140.0120.00016.84
8.0.130.0030.00313.25
8.0.120.0040.00416.84
8.0.110.0070.00016.88
8.0.100.0030.00516.66
8.0.90.0000.00716.71
8.0.80.0110.00616.74
8.0.70.0040.00416.69
8.0.60.0030.00616.85
8.0.50.0040.00416.87
8.0.30.0080.01016.97
8.0.20.0190.00917.40
8.0.10.0000.00816.79
8.0.00.0090.00816.55
7.4.330.0000.00615.07
7.4.320.0070.00016.72
7.4.300.0040.00416.59
7.4.290.0030.00716.73
7.4.280.0070.00016.56
7.4.270.0070.00016.64
7.4.260.0000.00716.64
7.4.250.0050.00316.62
7.4.240.0010.00616.77
7.4.230.0000.00716.77
7.4.220.0130.01316.81
7.4.210.0000.01516.68
7.4.200.0040.00416.68
7.4.160.0090.00616.70
7.4.150.0120.00617.40
7.4.140.0100.00917.86
7.4.130.0110.00616.75
7.4.120.0110.00816.68
7.4.110.0090.01216.79
7.4.100.0140.01116.51
7.4.90.0150.00416.72
7.4.80.0120.00619.39
7.4.70.0130.00316.87
7.4.60.0140.00716.77
7.4.50.0000.00516.43
7.4.40.0030.01316.84
7.4.30.0070.01116.79
7.4.00.0100.00714.95
7.3.330.0000.00613.53
7.3.320.0050.00013.57
7.3.310.0030.00316.57
7.3.300.0000.00716.45
7.3.290.0100.00316.59
7.3.280.0060.01116.55
7.3.270.0110.01117.40
7.3.260.0080.01616.62
7.3.250.0090.00816.67
7.3.240.0100.01016.79
7.3.230.0110.00716.73
7.3.210.0100.00716.57
7.3.200.0090.00819.39
7.3.190.0070.01016.84
7.3.180.0100.00616.80
7.3.170.0070.01016.60
7.3.160.0040.01216.70
7.3.120.0040.00715.15
7.2.330.0000.02316.99
7.2.320.0040.01316.46
7.2.310.0080.01617.03
7.2.300.0110.00616.91
7.2.290.0130.00616.68
7.2.60.0110.00316.95
7.2.00.0000.01119.39
7.1.200.0040.01116.03
7.1.100.0060.00616.23
7.1.70.0060.00317.43
7.1.60.0110.01119.40
7.1.50.0000.01417.27
7.1.00.0130.06722.57
7.0.200.0040.00417.07
7.0.140.0070.07021.96
7.0.60.0070.08021.71
7.0.50.0070.04317.86
7.0.40.0070.04020.15
7.0.30.0370.07320.09
7.0.20.0300.08020.34
7.0.10.0000.07020.09
7.0.00.0200.06720.09
5.6.280.0030.07321.05
5.6.210.0100.03720.68
5.6.200.0070.08318.16
5.6.190.0030.08320.77
5.6.180.0230.04720.63
5.6.170.0270.07020.71
5.6.160.0030.05720.52
5.6.150.0070.04018.29
5.6.140.0130.07318.29
5.6.130.0100.05018.14
5.6.120.0030.08721.14
5.6.110.0130.07721.12
5.6.100.0030.07721.09
5.6.90.0130.08720.96
5.6.80.0000.04020.54
5.5.350.3130.03320.40
5.5.340.0030.08017.95
5.5.330.0000.07320.28
5.5.320.0300.08020.24
5.5.310.0300.06720.34
5.5.300.0130.06317.98
5.5.290.0170.06318.07
5.5.280.0070.05720.91
5.5.270.0030.04320.81
5.5.260.0070.04320.77
5.5.250.0100.03320.56
5.5.240.0130.07020.20
5.4.450.2700.03719.48
5.4.440.4070.02719.48
5.4.430.3800.03719.45
5.4.420.3700.04019.54
5.4.410.3630.04019.36
5.4.400.3900.03018.95
5.4.390.3600.03719.15
5.4.380.5500.03719.11
5.4.370.4570.03019.13
5.4.360.3370.04018.99
5.4.350.3070.04718.94
5.4.340.4300.04719.23
5.4.320.3500.04319.06
5.4.310.3800.03719.22
5.4.300.3870.03719.20
5.4.290.3700.03018.93
5.4.280.3800.03319.01
5.4.270.3770.04318.98
5.4.260.0030.05319.06
5.4.250.0930.06019.25
5.4.240.3630.04019.10
5.4.230.3730.03719.21
5.4.220.4430.02719.20
5.4.210.4200.04019.04
5.4.200.4570.04018.98
5.4.190.4600.04019.23
5.4.180.3930.03719.07
5.4.170.3870.04019.16
5.4.160.3970.03319.11
5.4.150.3530.04019.21
5.4.140.4630.03016.43
5.4.130.5370.04016.51
5.4.120.4000.03316.40
5.4.110.4070.03316.57
5.4.100.4000.03316.41
5.4.90.3830.03316.53
5.4.80.3730.03316.52
5.4.70.4200.06016.39
5.4.60.4730.04316.42
5.4.50.4630.04016.39
5.4.40.2630.04716.49
5.4.30.2170.03316.49
5.4.20.4030.02716.32
5.4.10.3630.04016.62
5.4.00.3570.04015.85
5.3.290.3830.04014.69
5.3.280.4130.04314.61
5.3.270.4570.03314.67
5.3.260.3970.03714.77
5.3.250.3970.03714.63
5.3.240.4800.04714.61
5.3.230.4500.04014.62
5.3.220.3900.03014.57
5.3.210.3970.04314.61
5.3.200.3500.04014.72
5.3.190.3530.03714.60
5.3.180.3670.03314.58
5.3.170.3570.03314.58
5.3.160.4570.03714.50
5.3.150.4030.03714.61
5.3.140.2900.04014.59
5.3.130.3330.03714.56
5.3.120.3370.03314.45
5.3.110.3630.03314.59
5.3.100.3430.03714.14
5.3.90.3530.04014.07
5.3.80.3370.03714.03
5.3.70.3200.03714.08
5.3.60.3700.04014.00
5.3.50.3470.03013.98
5.3.40.3400.03313.92
5.3.30.4000.03313.91
5.3.20.3730.03313.65
5.3.10.3870.04713.66
5.3.00.3730.03313.64
5.2.170.2770.02711.12
5.2.160.3270.03011.21
5.2.150.3030.02711.15
5.2.140.3330.03011.19
5.2.130.3230.03011.04
5.2.120.3130.03011.13
5.2.110.3170.03311.18
5.2.100.3200.03011.26
5.2.90.3470.02711.17
5.2.80.3500.03011.06
5.2.70.2630.02711.26
5.2.60.3270.02311.05
5.2.50.3200.03011.17
5.2.40.2770.02711.01
5.2.30.2870.03310.90
5.2.20.2770.03311.02
5.2.10.3200.03310.85
5.2.00.2700.03310.87
5.1.60.3030.03010.02
5.1.50.2230.0309.90
5.1.40.2970.02710.00
5.1.30.2600.02710.23
5.1.20.2400.02310.45
5.1.10.2470.02710.02
5.1.00.2870.03010.04
5.0.50.1470.0278.47
5.0.40.1670.0138.48
5.0.30.1630.0378.20
5.0.20.1700.0208.36
5.0.10.1630.0208.23
5.0.00.1500.0378.14
4.4.90.1170.0176.33
4.4.80.1530.0136.33
4.4.70.1470.0106.33
4.4.60.1500.0176.33
4.4.50.1570.0206.33
4.4.40.1470.0236.33
4.4.30.1300.0176.33
4.4.20.1330.0176.33
4.4.10.1500.0176.33
4.4.00.1300.0176.33
4.3.110.1630.0236.33
4.3.100.1730.0206.33
4.3.90.1770.0136.33
4.3.80.1330.0276.33
4.3.70.1400.0176.33
4.3.60.1300.0136.33
4.3.50.1400.0176.33
4.3.40.1230.0236.33
4.3.30.0830.0206.33
4.3.20.0900.0236.33
4.3.10.0870.0236.33
4.3.00.0730.0176.33

preferences:
61.98 ms | 401 KiB | 5 Q