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; } 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.0160.00616.50
8.3.50.0180.00322.96
8.3.40.0120.00318.54
8.3.30.0090.00618.99
8.3.20.0040.00420.04
8.3.10.0080.00021.89
8.3.00.0030.00517.80
8.2.180.0130.01016.59
8.2.170.0130.00722.96
8.2.160.0070.01120.21
8.2.150.0080.00024.18
8.2.140.0030.00624.66
8.2.130.0040.00426.16
8.2.120.0040.00420.99
8.2.110.0090.00022.01
8.2.100.0060.00619.64
8.2.90.0040.00419.11
8.2.80.0080.00017.97
8.2.70.0030.00617.50
8.2.60.0050.00317.80
8.2.50.0000.00818.07
8.2.40.0050.00318.12
8.2.30.0000.00717.95
8.2.20.0000.00717.63
8.2.10.0040.00417.94
8.2.00.0040.00417.56
8.1.280.0070.01025.92
8.1.270.0040.00423.92
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0000.00823.74
8.1.230.0080.00319.08
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0030.00617.21
8.1.190.0040.00417.13
8.1.180.0000.00818.10
8.1.170.0050.00318.53
8.1.160.0080.00022.02
8.1.150.0040.00418.87
8.1.140.0000.00717.40
8.1.130.0000.00717.75
8.1.120.0040.00417.32
8.1.110.0050.00317.33
8.1.100.0000.00817.34
8.1.90.0040.00417.24
8.1.80.0000.00717.37
8.1.70.0030.00317.27
8.1.60.0080.00017.47
8.1.50.0030.00517.42
8.1.40.0040.00417.34
8.1.30.0040.00417.48
8.1.20.0040.00417.53
8.1.10.0040.00417.45
8.1.00.0030.00617.32
8.0.300.0070.00018.77
8.0.290.0050.00316.58
8.0.280.0040.00418.20
8.0.270.0030.00617.15
8.0.260.0030.00317.05
8.0.250.0030.00316.86
8.0.240.0040.00416.79
8.0.230.0030.00516.83
8.0.220.0020.00516.72
8.0.210.0030.00316.73
8.0.200.0000.00616.86
8.0.190.0040.00416.95
8.0.180.0000.00716.86
8.0.170.0030.00516.82
8.0.160.0030.00316.79
8.0.150.0000.00716.66
8.0.140.0060.00616.69
8.0.130.0000.00613.29
8.0.120.0080.00016.80
8.0.110.0000.00716.84
8.0.100.0040.00416.83
8.0.90.0040.00416.70
8.0.80.0060.01516.71
8.0.70.0030.00516.83
8.0.60.0030.00616.86
8.0.50.0080.00016.80
8.0.30.0110.01017.06
8.0.20.0140.00817.40
8.0.10.0050.00316.79
8.0.00.0080.00816.54
7.4.330.0050.00015.14
7.4.320.0030.00316.52
7.4.300.0040.00416.62
7.4.290.0070.00016.69
7.4.280.0050.00316.63
7.4.270.0040.00416.67
7.4.260.0030.00316.73
7.4.250.0030.00516.70
7.4.240.0050.00316.57
7.4.230.0030.00316.82
7.4.220.0100.00716.73
7.4.210.0100.01016.71
7.4.200.0000.00716.75
7.4.160.0090.00616.57
7.4.150.0160.01017.40
7.4.140.0140.00317.86
7.4.130.0130.00716.61
7.4.120.0070.01116.56
7.4.110.0070.01016.75
7.4.100.0070.01016.69
7.4.90.0030.01416.62
7.4.80.0140.00319.39
7.4.70.0140.00316.72
7.4.60.0070.01016.76
7.4.50.0000.00516.47
7.4.40.0080.00816.82
7.4.30.0070.01016.58
7.4.00.0040.01215.28
7.3.330.0060.00013.52
7.3.320.0020.00213.51
7.3.310.0000.00616.42
7.3.300.0000.00716.48
7.3.290.0070.01116.53
7.3.280.0110.00916.55
7.3.270.0040.01317.40
7.3.260.0070.01016.69
7.3.250.0100.00916.61
7.3.240.0100.01016.67
7.3.230.0130.00316.99
7.3.210.0110.00916.71
7.3.200.0060.01219.39
7.3.190.0070.01016.67
7.3.180.0070.01416.55
7.3.170.0030.01316.59
7.3.160.0040.01716.80
7.3.120.0100.00715.00
7.3.10.0030.01316.88
7.3.00.0030.01016.92
7.2.330.0000.02316.50
7.2.320.0070.01016.59
7.2.310.0070.01116.71
7.2.300.0030.01317.02
7.2.290.0070.01116.84
7.2.130.0030.01216.71
7.2.120.0030.01217.09
7.2.110.0070.00716.99
7.2.100.0080.00417.09
7.2.90.0120.00417.19
7.2.80.0000.01717.11
7.2.70.0060.00617.13
7.2.60.0060.00617.06
7.2.50.0040.00816.91
7.2.40.0100.00617.01
7.2.30.0070.01017.02
7.2.20.0070.00416.89
7.2.10.0060.00717.04
7.2.00.0050.00818.23
7.1.250.0000.00915.97
7.1.200.0000.01415.91
7.1.100.0030.01716.33
7.1.70.0040.00417.53
7.1.60.0110.00719.40
7.1.50.0100.00317.20
7.1.00.0000.08022.35
7.0.200.0030.00616.70
7.0.140.0070.06722.21
7.0.100.0000.08719.96
7.0.90.0130.08019.88
7.0.80.0070.09719.87
7.0.70.0070.08719.96
7.0.60.0170.07319.95
7.0.50.0100.08020.35
7.0.40.0100.04320.13
7.0.30.0170.07720.14
7.0.20.0170.07720.03
7.0.10.0100.08020.12
7.0.00.0100.08720.09
5.6.280.0030.07320.95
5.6.250.0030.08720.56
5.6.240.0170.07320.46
5.6.230.0070.06720.54
5.6.220.0130.04720.63
5.6.210.0230.07020.57
5.6.200.0170.07021.05
5.6.190.0130.07021.02
5.6.180.0130.08321.03
5.6.170.0100.09321.10
5.6.160.0070.07321.18
5.6.150.0070.06721.03
5.6.140.0130.07320.95
5.6.130.0030.08721.11
5.6.120.0000.08721.05
5.6.110.0100.06321.00
5.6.100.0100.07321.04
5.6.90.0100.08721.16
5.6.80.0070.07720.50
5.6.70.0130.06320.31
5.6.60.0070.08320.46
5.6.50.0130.07020.49
5.6.40.0100.05720.39
5.6.30.0100.06720.45
5.6.20.0100.07720.36
5.6.10.0130.07320.40
5.6.00.0170.07320.43
5.5.380.0070.07720.34
5.5.370.0100.08020.35
5.5.360.0070.06720.38
5.5.350.0070.08320.40
5.5.340.0000.08320.90
5.5.330.0170.07320.94
5.5.320.0000.08720.90
5.5.310.0070.07320.89
5.5.300.0130.07720.94
5.5.290.0070.08020.82
5.5.280.0100.08020.81
5.5.270.0100.07320.90
5.5.260.0070.08020.74
5.5.250.0130.07320.71
5.5.240.0070.08320.27
5.5.230.0130.07020.04
5.5.220.0030.08320.04
5.5.210.0100.07320.30
5.5.200.0070.06320.18
5.5.190.0170.07020.23
5.5.180.0200.03320.30
5.5.160.0170.05020.19
5.5.150.0070.05020.29
5.5.140.0030.07320.24
5.5.130.0100.03320.15
5.5.120.0030.04720.08
5.5.110.0030.04020.15
5.5.100.0030.04020.17
5.5.90.0000.04020.07
5.5.80.0070.04020.08
5.5.70.0000.04020.16
5.5.60.0100.03020.02
5.5.50.0070.07320.09
5.5.40.0100.03320.07
5.5.30.0030.06020.12
5.5.20.0000.04020.16
5.5.10.0100.03720.13
5.5.00.0030.04020.13
5.4.450.0130.05319.23
5.4.440.0000.08319.20
5.4.430.0130.07319.44
5.4.420.0070.08019.22
5.4.410.0000.08719.04
5.4.400.0070.07318.87
5.4.390.0030.08319.23
5.4.380.0130.06319.03
5.4.370.0100.07719.18
5.4.360.0070.08319.07
5.4.350.0070.07018.96
5.4.340.0130.07319.20
5.4.320.0000.04319.18
5.4.310.0000.04319.21
5.4.300.0170.06719.04
5.4.290.0030.04019.12
5.4.280.0130.04719.18
5.4.270.0100.03019.25
5.4.260.0000.04019.13
5.4.250.0130.02719.13
5.4.240.0070.07719.12
5.4.230.0030.03719.18
5.4.220.0030.04319.21
5.4.210.0030.03719.00
5.4.200.0100.02318.84
5.4.190.0070.05719.11
5.4.180.0100.06318.90
5.4.170.0030.05319.02
5.4.160.0000.04018.88
5.4.150.0070.03718.86
5.4.140.0030.03716.49
5.4.130.0030.03716.41
5.4.120.0100.02716.28
5.4.110.0000.04016.39
5.4.100.0000.04716.47
5.4.90.0000.04316.43
5.4.80.0100.03016.32
5.4.70.0030.03716.46
5.4.60.0070.03016.30
5.4.50.0100.03016.45
5.4.40.0000.03716.54
5.4.30.0030.03716.47
5.4.20.0030.03316.48
5.4.10.0030.05316.39
5.4.00.0130.02715.84
5.3.290.0100.04714.71
5.3.280.0070.04314.71
5.3.270.0130.05714.59
5.3.260.0070.03314.59
5.3.250.0100.03014.64
5.3.240.0070.03714.75
5.3.230.0070.03714.62
5.3.220.0100.03714.64
5.3.210.0030.04714.55
5.3.200.0070.03314.55
5.3.190.0100.03714.72
5.3.180.0000.04014.50
5.3.170.0030.03714.61
5.3.160.0030.04014.69
5.3.150.0000.04314.54
5.3.140.0030.03714.60
5.3.130.0030.03714.55
5.3.120.0000.04014.58
5.3.110.0070.04014.48
5.3.100.0070.03314.11
5.3.90.0070.03314.01
5.3.80.0070.03314.05
5.3.70.0030.03714.09
5.3.60.0100.03014.07
5.3.50.0030.04014.02
5.3.40.0070.04014.07
5.3.30.0000.04013.94
5.3.20.0130.02713.68
5.3.10.0070.07713.80
5.3.00.0100.06013.64
5.2.170.0100.02312.09
5.2.160.0000.03312.09
5.2.150.0000.03312.09
5.2.140.0100.02312.09
5.2.130.0030.03012.09
5.2.120.0000.03312.09
5.2.110.0070.06012.09
5.2.100.0000.06312.09
5.2.90.0070.05312.09
5.2.80.0030.02712.09
5.2.70.0070.05712.09
5.2.60.0070.05712.09
5.2.50.0130.05712.09
5.2.40.0030.06712.09
5.2.30.0070.06012.09
5.2.20.0000.07012.09
5.2.10.0130.05312.09
5.2.00.0130.04312.09
5.1.60.0030.03012.09
5.1.50.0030.03012.09
5.1.40.0130.05312.09
5.1.30.0130.04712.09
5.1.20.0030.04712.09
5.1.10.0000.04312.09
5.1.00.0070.03312.09
5.0.50.0100.02012.09
5.0.40.0000.04312.09
5.0.30.0030.03712.09
5.0.20.0070.04012.09
5.0.10.0030.04712.09
5.0.00.0070.06312.09
4.4.90.0000.03312.09
4.4.80.0100.02712.09
4.4.70.0000.03712.09
4.4.60.0000.04012.09
4.4.50.0030.02712.09
4.4.40.0070.05312.09
4.4.30.0030.02712.09
4.4.20.0000.02012.09
4.4.10.0030.03712.09
4.4.00.0030.05312.09
4.3.110.0030.02312.09
4.3.100.0100.02312.09
4.3.90.0030.03012.09
4.3.80.0000.05712.09
4.3.70.0070.03012.09
4.3.60.0000.04012.09
4.3.50.0030.04012.09
4.3.40.0030.05012.09
4.3.30.0030.03712.09
4.3.20.0000.02012.09
4.3.10.0030.03712.09
4.3.00.0000.03312.09

preferences:
53.78 ms | 400 KiB | 5 Q