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 $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.0030.01716.50
8.3.50.0120.00722.87
8.3.40.0150.00618.85
8.3.30.0000.01519.00
8.3.20.0000.00820.29
8.3.10.0090.00021.50
8.3.00.0050.00317.65
8.2.180.0070.01318.29
8.2.170.0110.00422.96
8.2.160.0130.00720.55
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0100.00321.09
8.2.110.0090.00022.10
8.2.100.0040.00818.03
8.2.90.0050.00319.09
8.2.80.0040.00417.97
8.2.70.0000.00917.63
8.2.60.0000.00917.90
8.2.50.0040.00418.07
8.2.40.0050.00317.91
8.2.30.0060.00317.97
8.2.20.0000.00817.44
8.2.10.0000.00717.85
8.2.00.0000.00717.45
8.1.280.0120.00625.92
8.1.270.0080.00023.83
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0000.00921.92
8.1.230.0060.00619.07
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0030.00617.13
8.1.190.0040.00416.97
8.1.180.0040.00418.10
8.1.170.0000.00918.50
8.1.160.0040.00422.01
8.1.150.0050.00318.71
8.1.140.0030.00617.33
8.1.130.0000.00717.68
8.1.120.0040.00417.26
8.1.110.0040.00417.23
8.1.100.0050.00217.23
8.1.90.0040.00417.41
8.1.80.0040.00417.29
8.1.70.0070.00017.32
8.1.60.0060.00317.37
8.1.50.0000.00817.29
8.1.40.0000.00817.28
8.1.30.0030.00617.51
8.1.20.0000.00717.38
8.1.10.0000.00717.36
8.1.00.0040.00417.21
8.0.300.0040.00418.77
8.0.290.0000.00716.63
8.0.280.0030.00318.25
8.0.270.0000.00817.04
8.0.260.0060.00017.15
8.0.250.0040.00416.79
8.0.240.0090.00016.98
8.0.230.0030.00316.88
8.0.220.0050.00216.90
8.0.210.0030.00316.80
8.0.200.0030.00316.79
8.0.190.0000.00716.85
8.0.180.0000.00716.90
8.0.170.0000.00716.91
8.0.160.0040.00416.72
8.0.150.0000.00816.83
8.0.140.0000.01016.71
8.0.130.0030.00313.26
8.0.120.0000.00916.77
8.0.110.0040.00416.83
8.0.100.0020.00516.67
8.0.90.0030.00316.74
8.0.80.0120.00316.81
8.0.70.0040.00416.72
8.0.60.0050.00216.80
8.0.50.0050.00316.71
8.0.30.0120.00917.01
8.0.20.0120.00817.40
8.0.10.0060.00316.98
8.0.00.0080.01116.58
7.4.330.0000.00515.00
7.4.320.0000.00616.72
7.4.300.0070.00016.53
7.4.290.0040.00416.56
7.4.280.0000.00716.66
7.4.270.0030.00316.63
7.4.260.0000.00716.64
7.4.250.0000.00716.68
7.4.240.0040.00416.72
7.4.230.0050.00216.56
7.4.220.0070.01516.85
7.4.210.0140.00016.60
7.4.200.0030.00316.76
7.4.160.0200.00616.74
7.4.150.0160.00317.40
7.4.140.0090.00917.86
7.4.130.0140.00716.76
7.4.120.0120.00616.65
7.4.110.0060.01116.67
7.4.100.0070.01116.57
7.4.90.0070.01016.64
7.4.80.0090.01319.39
7.4.70.0030.01316.54
7.4.60.0110.00716.65
7.4.50.0090.00016.57
7.4.40.0080.01216.75
7.4.30.0140.00416.60
7.4.00.0060.00614.98
7.3.330.0000.00513.43
7.3.320.0050.00013.41
7.3.310.0030.00316.44
7.3.300.0070.00016.48
7.3.290.0060.01216.54
7.3.280.0080.00916.57
7.3.270.0140.00517.40
7.3.260.0110.00816.50
7.3.250.0110.00916.53
7.3.240.0200.00316.81
7.3.230.0070.01016.67
7.3.210.0110.00716.71
7.3.200.0170.00419.39
7.3.190.0110.00716.79
7.3.180.0060.00916.47
7.3.170.0090.01216.88
7.3.160.0130.00316.65
7.3.120.0070.00715.00
7.2.330.0070.01116.53
7.2.320.0120.00616.96
7.2.310.0000.01716.62
7.2.300.0090.00916.98
7.2.290.0070.01016.76
7.2.60.0060.00316.88
7.2.00.0060.00919.41
7.1.200.0030.00315.93
7.1.100.0000.01118.25
7.1.70.0030.00517.55
7.1.60.0210.00319.40
7.1.50.0070.01017.24
7.1.00.0030.07722.30
7.0.200.0000.00816.64
7.0.140.0130.06322.05
7.0.60.0130.07720.03
7.0.50.0000.04717.88
7.0.40.0100.08020.24
7.0.30.0200.08320.12
7.0.20.0200.04320.33
7.0.10.0100.07720.25
7.0.00.0030.04320.22
5.6.280.0070.07020.80
5.6.210.0100.07720.77
5.6.200.0070.08718.24
5.6.190.0130.06020.55
5.6.180.0200.03720.52
5.6.170.0230.08020.56
5.6.160.0000.04320.44
5.6.150.0070.07718.29
5.6.140.0030.04018.14
5.6.130.0030.04318.21
5.6.120.0070.07721.01
5.6.110.0030.07020.97
5.6.100.0070.07720.95
5.6.90.0100.06020.99
5.6.80.0170.07720.45
5.5.350.0230.04020.42
5.5.340.0070.04718.14
5.5.330.0030.08720.30
5.5.320.0170.04720.32
5.5.310.0330.06720.26
5.5.300.0100.08018.04
5.5.290.0130.06717.95
5.5.280.0030.08720.87
5.5.270.0070.08320.88
5.5.260.0070.08020.81
5.5.250.0100.06320.60
5.5.240.0070.04720.14
5.4.450.3430.03719.42
5.4.440.2900.03719.31
5.4.430.3300.04319.58
5.4.420.4170.03719.55
5.4.410.3400.03719.41
5.4.400.3200.03718.98
5.4.390.3200.03719.22
5.4.380.3530.04018.84
5.4.370.3200.03718.87
5.4.360.3070.03719.13
5.4.350.3300.02719.00
5.4.340.3430.03319.00
5.4.320.3130.04019.22
5.4.310.3400.04319.05
5.4.300.3200.04019.16
5.4.290.3130.03719.13
5.4.280.3330.04319.23
5.4.270.3270.02718.98
5.4.260.3230.03319.22
5.4.250.3370.04019.13
5.4.240.3270.03719.16
5.4.230.3330.03319.19
5.4.220.3400.04018.94
5.4.210.3400.03318.83
5.4.200.3300.03318.94
5.4.190.3470.03719.23
5.4.180.3130.04019.12
5.4.170.3830.03719.08
5.4.160.4030.03718.93
5.4.150.3670.03719.20
5.4.140.3530.03716.56
5.4.130.3500.03716.56
5.4.120.3170.04016.44
5.4.110.3130.04016.56
5.4.100.3400.03716.45
5.4.90.3430.04316.42
5.4.80.3330.03716.57
5.4.70.3570.03016.39
5.4.60.3130.04016.51
5.4.50.3400.03316.18
5.4.40.3400.03316.34
5.4.30.3170.03716.43
5.4.20.3470.04016.29
5.4.10.3100.03316.48
5.4.00.4900.04015.93
5.3.290.4130.04314.73
5.3.280.4170.03014.52
5.3.270.3470.04314.64
5.3.260.3500.03314.77
5.3.250.2770.03714.53
5.3.240.3300.03714.63
5.3.230.3330.03314.51
5.3.220.3270.03714.48
5.3.210.3430.03714.49
5.3.200.3300.03714.57
5.3.190.3670.03314.55
5.3.180.3400.04014.49
5.3.170.3630.04314.63
5.3.160.3470.03714.58
5.3.150.3130.04014.59
5.3.140.3230.03014.68
5.3.130.3200.04014.57
5.3.120.3100.04314.55
5.3.110.3470.04014.47
5.3.100.3500.04014.16
5.3.90.3930.03714.14
5.3.80.4100.03713.95
5.3.70.4230.02714.04
5.3.60.4170.03314.13
5.3.50.4200.03013.88
5.3.40.3730.03313.97
5.3.30.4070.04013.90
5.3.20.3930.03313.61
5.3.10.3730.03313.81
5.3.00.2700.03313.66
5.2.170.1530.03011.34
5.2.160.1800.03011.34
5.2.150.2170.03011.34
5.2.140.2770.03011.39
5.2.130.2600.03011.34
5.2.120.2870.02711.34
5.2.110.2470.02711.34
5.2.100.2500.02311.34
5.2.90.2430.02711.34
5.2.80.2870.03011.34
5.2.70.2870.03711.34
5.2.60.2530.02711.34
5.2.50.2000.02711.34
5.2.40.1870.03011.34
5.2.30.1600.02311.34
5.2.20.2100.03011.34
5.2.10.1700.02711.34
5.2.00.2200.03011.34
5.1.60.1130.02011.34
5.1.50.1630.02011.34
5.1.40.1070.02011.34
5.1.30.2100.02011.34
5.1.20.2200.02311.34
5.1.10.2100.03011.34
5.1.00.2130.02011.34
5.0.50.1230.02711.34
5.0.40.1100.02011.34
5.0.30.1100.03011.34
5.0.20.1300.02311.34
5.0.10.1300.02011.34
5.0.00.1270.03711.34
4.4.90.1070.01711.34
4.4.80.1130.01711.34
4.4.70.1070.01311.34
4.4.60.1230.01711.34
4.4.50.1170.01311.34
4.4.40.1300.02711.34
4.4.30.1200.01711.34
4.4.20.0830.01711.34
4.4.10.1230.01311.34
4.4.00.1170.03011.34
4.3.110.0900.01311.34
4.3.100.1000.01311.34
4.3.90.1030.01311.34
4.3.80.1100.02311.34
4.3.70.1200.01011.34
4.3.60.1070.01311.34
4.3.50.1300.01711.34
4.3.40.1270.02311.34
4.3.30.0600.02011.34
4.3.20.0570.01711.34
4.3.10.0500.01711.34
4.3.00.0600.01311.34

preferences:
45.33 ms | 401 KiB | 5 Q