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.40.0090.00618.71
8.3.30.0100.00319.00
8.3.20.0060.00320.28
8.3.10.0040.00421.90
8.3.00.0080.00017.80
8.2.170.0110.00418.81
8.2.160.0040.00922.96
8.2.150.0080.00024.18
8.2.140.0030.00624.66
8.2.130.0070.00026.16
8.2.120.0110.00421.00
8.2.110.0060.00321.96
8.2.100.0040.00717.97
8.2.90.0040.00419.09
8.2.80.0000.00817.97
8.2.70.0000.00817.47
8.2.60.0060.00317.80
8.2.50.0040.00418.07
8.2.40.0030.00518.22
8.2.30.0040.00417.87
8.2.20.0040.00417.44
8.2.10.0000.00717.85
8.2.00.0040.00417.54
8.1.270.0040.00423.72
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0090.00022.13
8.1.230.0000.01119.14
8.1.220.0030.00517.74
8.1.210.0030.00518.77
8.1.200.0060.00317.23
8.1.190.0030.00517.10
8.1.180.0060.00318.10
8.1.170.0040.00418.48
8.1.160.0080.00021.96
8.1.150.0000.00718.60
8.1.140.0040.00417.27
8.1.130.0030.00317.64
8.1.120.0040.00417.25
8.1.110.0040.00417.23
8.1.100.0000.00717.29
8.1.90.0030.00617.36
8.1.80.0040.00417.40
8.1.70.0040.00417.21
8.1.60.0000.00717.39
8.1.50.0060.00317.36
8.1.40.0050.00217.43
8.1.30.0040.00417.42
8.1.20.0060.00317.45
8.1.10.0080.00017.29
8.1.00.0040.00417.16
8.0.300.0040.00418.77
8.0.290.0040.00416.63
8.0.280.0030.00318.33
8.0.270.0000.00717.10
8.0.260.0040.00417.18
8.0.250.0000.00716.88
8.0.240.0030.00516.77
8.0.230.0030.00316.80
8.0.220.0030.00316.81
8.0.210.0050.00316.83
8.0.200.0030.00316.93
8.0.190.0050.00316.89
8.0.180.0040.00416.75
8.0.170.0040.00416.77
8.0.160.0000.00816.90
8.0.150.0030.00516.80
8.0.140.0030.00716.80
8.0.130.0030.00313.22
8.0.120.0080.00016.69
8.0.110.0000.00716.80
8.0.100.0060.00316.72
8.0.90.0030.00516.69
8.0.80.0080.00816.89
8.0.70.0040.00416.84
8.0.60.0000.00816.89
8.0.50.0000.00716.73
8.0.30.0100.01116.91
8.0.20.0050.01317.40
8.0.10.0000.00716.78
8.0.00.0090.00916.73
7.4.330.0060.00015.14
7.4.320.0000.00616.68
7.4.300.0000.00616.65
7.4.290.0040.00416.70
7.4.280.0070.00016.71
7.4.270.0040.00416.77
7.4.260.0030.00316.62
7.4.250.0050.00316.68
7.4.240.0040.00416.73
7.4.230.0040.00416.74
7.4.220.0100.00716.66
7.4.210.0080.00916.70
7.4.200.0070.00016.77
7.4.160.0170.00316.54
7.4.150.0040.01617.40
7.4.140.0040.01317.86
7.4.130.0100.00916.59
7.4.120.0090.01016.59
7.4.110.0030.01316.74
7.4.100.0120.00616.55
7.4.90.0060.01216.81
7.4.80.0130.00419.39
7.4.70.0060.01116.53
7.4.60.0070.01116.77
7.4.50.0000.00816.71
7.4.40.0160.00616.57
7.4.30.0060.01516.42
7.4.00.0160.00314.86
7.3.330.0030.00313.39
7.3.320.0000.00513.58
7.3.310.0000.00716.58
7.3.300.0000.00716.45
7.3.290.0100.00416.48
7.3.280.0100.00616.58
7.3.270.0100.01117.40
7.3.260.0110.01116.73
7.3.250.0080.01216.70
7.3.240.0090.00916.78
7.3.230.0080.00816.50
7.3.210.0150.00316.70
7.3.200.0030.01519.39
7.3.190.0070.01416.70
7.3.180.0080.00816.57
7.3.170.0170.00016.80
7.3.160.0070.01116.59
7.3.120.0040.01314.97
7.3.110.0100.00915.02
7.3.100.0070.00815.00
7.3.90.0080.00715.04
7.3.80.0080.00715.02
7.3.70.0090.00915.04
7.3.60.0110.00515.04
7.3.50.0070.00815.03
7.3.40.0070.01014.94
7.3.30.0080.00714.91
7.3.20.0090.00616.30
7.3.10.0060.01016.34
7.3.00.0050.01016.25
7.2.330.0090.00816.65
7.2.320.0050.01416.98
7.2.310.0060.01216.70
7.2.300.0080.00816.56
7.2.290.0110.00516.50
7.2.250.0060.01215.47
7.2.240.0080.00915.25
7.2.230.0060.01115.23
7.2.220.0090.00815.16
7.2.210.0090.00815.23
7.2.200.0070.00915.24
7.2.190.0060.00915.16
7.2.180.0070.01015.22
7.2.170.0080.00715.07
7.2.160.0090.00715.24
7.2.150.0090.00516.43
7.2.140.0070.00916.49
7.2.130.0090.00716.33
7.2.120.0110.00716.35
7.2.110.0060.01116.49
7.2.100.0080.00916.35
7.2.90.0040.01216.33
7.2.80.0090.00616.24
7.2.70.0080.00516.51
7.2.60.0070.00816.60
7.2.50.0050.01116.30
7.2.40.0050.01216.42
7.2.30.0070.01016.40
7.2.20.0090.00816.51
7.2.10.0090.00616.45
7.2.00.0070.00917.28
7.1.330.0080.00915.44
7.1.320.0090.00615.29
7.1.310.0040.01215.33
7.1.300.0060.01015.41
7.1.290.0070.00915.19
7.1.280.0040.00915.37
7.1.270.0090.00515.24
7.1.260.0050.01015.36
7.1.250.0050.00715.16
7.1.240.0030.01614.21
7.1.230.0090.00914.20
7.1.220.0090.00914.12
7.1.210.0080.00514.16
7.1.200.0080.00714.90
7.1.190.0080.00814.15
7.1.180.0080.00814.07
7.1.170.0070.00714.19
7.1.160.0060.00914.20
7.1.150.0070.01313.87
7.1.140.0100.01013.99
7.1.130.0000.01913.88
7.1.120.0050.00913.95
7.1.110.0040.01214.27
7.1.100.0050.01116.31
7.1.90.0040.00914.18
7.1.80.0180.00414.29
7.1.70.0060.00515.85
7.1.60.0100.00916.82
7.1.50.0130.00715.69
7.1.40.0070.00714.19
7.1.30.0110.00414.14
7.1.20.0110.00314.24
7.1.10.0030.01313.91
7.1.00.0040.04218.31
7.0.330.0150.00713.84
7.0.320.0110.01113.72
7.0.310.0310.00913.86
7.0.300.0190.00313.64
7.0.290.0180.00413.57
7.0.280.0160.00813.66
7.0.270.0140.00813.65
7.0.260.0120.01013.52
7.0.250.0140.00713.66
7.0.240.0090.01613.53
7.0.230.0000.02113.69
7.0.220.0210.00313.84
7.0.210.0100.01013.72
7.0.200.0060.01015.26
7.0.190.0160.00313.80
7.0.180.0140.00413.43
7.0.170.0170.00713.54
7.0.160.0100.01413.42
7.0.150.0120.00613.43
7.0.140.0110.03917.86
7.0.130.0110.01313.75
7.0.120.0210.00313.52
7.0.110.0160.00813.75
7.0.100.0140.00513.46
7.0.90.0190.00013.50
7.0.80.0150.00613.60
7.0.70.0170.00413.31
7.0.60.0140.02416.72
7.0.50.0100.04315.88
7.0.40.0130.02916.79
7.0.30.0200.04516.80
7.0.20.0260.04216.98
7.0.10.0100.05116.89
7.0.00.0110.02116.86
5.6.400.0060.00914.75
5.6.390.0060.01314.66
5.6.380.0040.01114.81
5.6.370.0070.01614.52
5.6.360.0090.00914.49
5.6.350.0180.00314.33
5.6.340.0170.00714.60
5.6.330.0150.00914.44
5.6.320.0120.00814.35
5.6.310.0110.01114.45
5.6.300.0180.00614.52
5.6.290.0120.01114.70
5.6.280.0030.04517.64
5.6.270.0130.00914.41
5.6.260.0120.00814.54
5.6.250.0140.00414.50
5.6.240.0160.00714.21
5.6.230.0110.01214.66
5.6.220.0200.00614.43
5.6.210.0180.03817.44
5.6.200.0130.04616.36
5.6.190.0120.04717.47
5.6.180.0180.02517.53
5.6.170.0190.04417.49
5.6.160.0120.04217.58
5.6.150.0060.03116.38
5.6.140.0120.02516.49
5.6.130.0120.02316.15
5.6.120.0090.04517.79
5.6.110.0070.04817.70
5.6.100.0170.04217.65
5.6.90.0110.03017.85
5.6.80.0090.03117.52
5.6.70.0130.00614.39
5.6.60.0170.00214.36
5.6.50.0050.01514.70
5.6.40.0170.00514.35
5.6.30.0030.02114.52
5.6.20.0080.01214.47
5.6.10.0200.00014.59
5.6.00.0170.00714.60
5.5.380.0170.00614.23
5.5.370.0180.00314.57
5.5.360.0090.01214.55
5.5.350.1490.02217.51
5.5.340.0050.03416.13
5.5.330.0130.04017.36
5.5.320.0190.02617.36
5.5.310.0180.02917.21
5.5.300.0070.02916.11
5.5.290.0130.03016.13
5.5.280.0040.03817.60
5.5.270.0130.03417.57
5.5.260.0090.03517.59
5.5.250.0110.04317.56
5.5.240.0080.03117.18
5.5.230.0140.00514.26
5.5.220.0170.00414.21
5.5.210.0190.00514.80
5.5.200.0090.00914.41
5.5.190.0210.00714.61
5.5.180.0080.01114.42
5.5.170.0140.00814.18
5.5.160.0150.00914.59
5.5.150.0220.00614.30
5.5.140.0160.00814.32
5.5.130.0160.00514.65
5.5.120.0490.02014.18
5.5.110.0210.00914.37
5.5.100.0060.01514.35
5.5.90.0200.01414.19
5.5.80.0190.00814.29
5.5.70.0270.01014.59
5.5.60.0160.01114.29
5.5.50.0160.00914.65
5.5.40.0220.00914.40
5.5.30.0160.01214.61
5.5.20.0100.02414.43
5.5.10.0190.01114.61
5.5.00.0190.00914.66
5.4.450.0440.03415.48
5.4.440.0120.03415.08
5.4.430.0170.02715.24
5.4.420.0140.03115.27
5.4.410.0090.03015.26
5.4.400.0370.03115.22
5.4.390.0390.03115.33
5.4.380.0170.02514.96
5.4.370.0150.02414.67
5.4.360.0100.03114.89
5.4.350.0100.02511.67
5.4.340.0140.02411.64
5.4.330.0080.00811.14
5.4.320.0110.01811.98
5.4.310.0110.02011.87
5.4.300.0080.02311.96
5.4.290.0110.02811.90
5.4.280.0180.02811.67
5.4.270.0160.02211.75
5.4.260.0070.02311.94
5.4.250.0080.02311.88
5.4.240.0120.02011.67
5.4.230.0090.02211.82
5.4.220.0060.02511.82
5.4.210.0130.02611.71
5.4.200.0080.02411.83
5.4.190.0110.02111.70
5.4.180.0130.02311.84
5.4.170.0130.02011.81
5.4.160.0070.02511.88
5.4.150.0090.02311.79
5.4.140.0120.02011.70
5.4.130.0040.02711.66
5.4.120.0080.02311.73
5.4.110.0080.02011.53
5.4.100.0080.02211.64
5.4.90.0080.02311.66
5.4.80.0110.01911.68
5.4.70.0080.02011.66
5.4.60.0090.02011.67
5.4.50.0120.01811.53
5.4.40.0080.02011.68
5.4.30.0110.01811.62
5.4.20.0060.02411.70
5.4.10.0070.02211.69
5.4.00.0150.02111.38
5.3.290.0060.02611.85
5.3.280.0110.02011.74
5.3.270.0100.02911.82
5.3.260.0090.02611.81
5.3.250.0080.02511.65
5.3.240.0100.02111.71
5.3.230.0160.02311.79
5.3.220.0120.02011.70
5.3.210.0110.02311.70
5.3.200.0080.02211.71
5.3.190.0100.02111.73
5.3.180.0100.01811.78
5.3.170.0100.02111.74
5.3.160.0080.02211.66
5.3.150.0100.02211.81
5.3.140.0120.02511.76
5.3.130.0080.02611.76
5.3.120.0030.02811.71
5.3.110.0080.02211.65
5.3.100.0100.02011.33
5.3.90.0120.01711.52
5.3.80.0100.02411.40
5.3.70.0100.02411.40
5.3.60.0090.02411.29
5.3.50.0080.02511.37
5.3.40.0080.02311.46
5.3.30.0120.01811.48
5.3.20.0090.02011.26
5.3.10.0120.01711.18
5.3.00.0070.02511.08
5.2.170.0070.0189.54
5.2.160.0090.0159.54
5.2.150.0100.0169.54
5.2.140.0070.0199.55
5.2.130.0050.0189.38
5.2.120.0070.0189.48
5.2.110.0070.0219.43
5.2.100.0070.0199.43
5.2.90.0070.0189.42
5.2.80.0090.0229.23
5.2.70.0050.0209.36
5.2.60.0060.0209.36
5.2.50.0090.0179.32
5.2.40.0100.0159.23
5.2.30.0070.0189.29
5.2.20.0060.0179.24
5.2.10.0050.0199.12
5.2.00.0050.0209.08
5.1.60.0070.0148.69
5.1.50.0050.0188.69
5.1.40.0030.0188.67
5.1.30.0050.0178.85
5.1.20.0060.0168.86
5.1.10.0110.0178.72
5.1.00.0080.0148.72
5.0.50.0040.0137.96
5.0.40.0040.0127.90
5.0.30.0050.0167.80
5.0.20.0050.0117.78
5.0.10.0030.0137.78
5.0.00.0040.0177.77
4.4.90.0070.0077.02
4.4.80.0030.0107.01
4.4.70.0070.0097.01
4.4.60.0060.0107.01
4.4.50.0060.0077.02
4.4.40.0050.0136.99
4.4.30.0010.0127.02
4.4.20.0040.0097.06
4.4.10.0050.0087.06
4.4.00.0020.0167.01
4.3.110.0020.0106.97
4.3.100.0060.0076.97
4.3.90.0060.0076.95
4.3.80.0040.0146.93
4.3.70.0040.0106.95
4.3.60.0030.0096.95
4.3.50.0040.0096.95
4.3.40.0020.0186.90
4.3.30.0040.0126.28
4.3.20.0030.0156.28
4.3.10.0050.0126.25
4.3.00.0070.0188.17

preferences:
42.57 ms | 400 KiB | 5 Q