3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyDateTime extends DateTime{ public function __construct($params) { parent::__construct($params); } 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.70.0090.00916.63
8.3.60.0070.01016.88
8.3.50.0150.00322.83
8.3.40.0140.00718.67
8.3.30.0070.00719.04
8.3.20.0000.00820.29
8.3.10.0040.00421.90
8.3.00.0040.00417.93
8.2.180.0090.00916.88
8.2.170.0150.00022.96
8.2.160.0100.00320.38
8.2.150.0030.00624.18
8.2.140.0030.00624.66
8.2.130.0000.00826.16
8.2.120.0040.01120.77
8.2.110.0080.00020.38
8.2.100.0120.00017.66
8.2.90.0050.00318.97
8.2.80.0050.00317.97
8.2.70.0000.00817.38
8.2.60.0050.00317.68
8.2.50.0040.00418.07
8.2.40.0040.00418.09
8.2.30.0080.00017.83
8.2.20.0070.00017.48
8.2.10.0050.00318.00
8.2.00.0040.00417.44
8.1.280.0150.00425.92
8.1.270.0000.00823.82
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0090.00322.05
8.1.230.0000.01123.94
8.1.220.0040.00417.74
8.1.210.0060.00318.77
8.1.200.0030.00717.10
8.1.190.0050.00317.10
8.1.180.0040.00418.10
8.1.170.0090.00018.51
8.1.160.0000.00721.85
8.1.150.0040.00418.79
8.1.140.0040.00417.20
8.1.130.0030.00317.82
8.1.120.0000.00817.25
8.1.110.0050.00317.34
8.1.100.0080.00017.31
8.1.90.0000.00817.34
8.1.80.0030.00517.27
8.1.70.0000.00717.22
8.1.60.0040.00417.42
8.1.50.0000.00717.30
8.1.40.0040.00417.38
8.1.30.0060.00317.57
8.1.20.0050.00217.54
8.1.10.0040.00417.29
8.1.00.0060.00317.29
8.0.300.0040.00418.77
8.0.290.0000.00716.63
8.0.280.0070.00018.24
8.0.270.0000.00717.13
8.0.260.0030.00317.15
8.0.250.0000.00716.88
8.0.240.0040.00416.87
8.0.230.0030.00316.76
8.0.220.0080.00016.75
8.0.210.0000.00816.76
8.0.200.0000.00616.96
8.0.190.0030.00616.86
8.0.180.0040.00416.88
8.0.170.0030.00516.88
8.0.160.0040.00416.68
8.0.150.0070.00016.68
8.0.140.0090.00016.78
8.0.130.0030.00313.22
8.0.120.0030.00516.79
8.0.110.0030.00516.77
8.0.100.0000.00716.70
8.0.90.0040.00416.86
8.0.80.0090.00616.81
8.0.70.0000.00816.90
8.0.60.0030.00616.82
8.0.50.0000.00716.71
8.0.30.0100.01016.96
8.0.20.0090.01017.40
8.0.10.0040.00416.95
8.0.00.0090.00916.64
7.4.330.0000.00515.15
7.4.320.0030.00316.68
7.4.300.0040.00416.76
7.4.290.0000.01116.70
7.4.280.0030.00316.74
7.4.270.0000.00716.66
7.4.260.0000.00716.61
7.4.250.0040.00416.65
7.4.240.0020.00516.70
7.4.230.0030.00316.73
7.4.220.0210.00316.68
7.4.210.0070.01316.77
7.4.200.0030.00516.60
7.4.160.0050.01116.83
7.4.150.0120.00817.40
7.4.140.0100.00817.86
7.4.130.0080.00816.68
7.4.120.0120.00616.72
7.4.110.0130.00916.77
7.4.100.0070.01116.75
7.4.90.0130.00416.80
7.4.80.0130.01419.39
7.4.70.0150.00616.74
7.4.60.0000.01816.76
7.4.50.0000.00816.39
7.4.40.0060.01016.61
7.4.30.0110.00816.73
7.4.10.0070.01114.98
7.4.00.0080.00715.28
7.3.330.0070.00013.50
7.3.320.0030.00313.31
7.3.310.0030.00316.63
7.3.300.0030.00316.52
7.3.290.0070.00716.59
7.3.280.0090.01016.54
7.3.270.0060.01517.40
7.3.260.0060.01216.70
7.3.250.0070.01016.60
7.3.240.0160.00616.59
7.3.230.0100.00716.91
7.3.210.0100.00716.70
7.3.200.0110.01119.39
7.3.190.0130.01016.74
7.3.180.0030.01216.58
7.3.170.0030.01216.74
7.3.160.0060.01616.61
7.3.130.0110.00415.13
7.3.120.0120.00515.01
7.3.110.0070.01015.09
7.3.100.0070.00614.97
7.3.90.0060.00715.03
7.3.80.0080.00615.08
7.3.70.0050.00815.09
7.3.60.0090.00514.79
7.3.50.0040.00915.03
7.3.40.0050.00814.96
7.3.30.0050.01015.08
7.3.20.0050.01016.80
7.3.10.0040.00916.85
7.3.00.0020.00816.79
7.2.330.0070.01116.71
7.2.320.0090.00616.54
7.2.310.0100.01016.51
7.2.300.0080.00916.80
7.2.290.0000.01616.82
7.2.260.0100.01015.21
7.2.250.0080.00915.34
7.2.240.0020.01715.13
7.2.230.0070.01015.23
7.2.220.0080.00415.13
7.2.210.0050.01014.99
7.2.200.0040.00715.13
7.2.190.0090.00615.15
7.2.180.0080.00515.07
7.2.170.0020.01215.02
7.2.160.0040.00815.25
7.2.150.0070.00716.83
7.2.140.0120.00616.93
7.2.130.0130.00316.82
7.2.120.0070.00717.09
7.2.110.0090.00316.97
7.2.100.0030.01216.75
7.2.90.0040.01117.21
7.2.80.0070.00717.13
7.2.70.0030.01316.95
7.2.60.0090.00617.04
7.2.50.0100.00317.17
7.2.40.0030.01017.13
7.2.30.0060.01016.75
7.2.20.0060.00917.04
7.2.10.0030.00917.14
7.2.00.0030.01016.75
7.1.330.0050.00815.82
7.1.320.0070.00615.93
7.1.310.0050.00816.00
7.1.300.0060.00915.91
7.1.290.0060.00915.89
7.1.280.0060.00715.93
7.1.270.0080.00615.83
7.1.260.0060.00915.92
7.1.250.0070.01015.98
7.1.240.0070.00715.87
7.1.230.0040.01116.01
7.1.220.0060.00316.07
7.1.210.0030.01016.17
7.1.200.0090.00415.94
7.1.190.0030.01315.79
7.1.180.0000.01316.05
7.1.170.0000.01416.07
7.1.160.0000.01116.14
7.1.150.0000.00916.03
7.1.140.0060.00815.85
7.1.130.0090.00615.82
7.1.120.0100.00315.96
7.1.110.0030.01016.02
7.1.100.0000.01415.79
7.1.90.0030.01016.05
7.1.80.0060.00616.03
7.1.70.0050.00616.82
7.1.60.0060.01317.67
7.1.50.0050.00816.31
7.1.40.0060.00915.97
7.1.30.0000.01315.82
7.1.20.0060.01015.67
7.1.10.0120.00315.97
7.1.00.0040.04319.06
7.0.330.0030.01015.39
7.0.320.0000.01215.67
7.0.310.0110.00415.61
7.0.300.0000.01115.17
7.0.290.0060.00815.55
7.0.280.0060.00315.41
7.0.270.0100.00315.21
7.0.260.0060.00315.52
7.0.250.0070.01015.53
7.0.240.0030.00615.30
7.0.230.0100.00315.51
7.0.220.0030.01015.75
7.0.210.0040.00415.75
7.0.200.0050.00516.29
7.0.190.0090.00315.66
7.0.180.0080.00015.64
7.0.170.0100.00015.48
7.0.160.0090.00415.50
7.0.150.0060.00615.63
7.0.140.0020.04418.79
7.0.130.0050.00515.40
7.0.120.0030.01015.43
7.0.110.0080.00815.57
7.0.100.0000.01015.48
7.0.90.0120.00315.43
7.0.80.0030.00715.24
7.0.70.0030.01315.51
7.0.60.0030.03517.87
7.0.50.0050.04916.70
7.0.40.0130.02216.78
7.0.30.0120.03316.84
7.0.20.0220.03916.92
7.0.10.0070.02716.95
7.0.00.0060.02417.01
5.6.400.0030.01314.81
5.6.390.0070.01114.56
5.6.380.0030.01314.42
5.6.370.0070.01014.92
5.6.360.0030.00914.69
5.6.350.0090.00014.28
5.6.340.0030.01414.28
5.6.330.0040.00814.52
5.6.320.0090.00314.56
5.6.310.0070.00714.79
5.6.300.0030.00614.78
5.6.290.0110.00414.28
5.6.280.0050.04217.91
5.6.270.0120.00314.50
5.6.260.0070.00714.73
5.6.250.0000.01114.91
5.6.240.0040.01414.71
5.6.230.0040.01214.44
5.6.220.0060.01014.44
5.6.210.0030.04017.60
5.6.200.0100.04016.46
5.6.190.0070.04917.48
5.6.180.0100.02917.45
5.6.170.0170.05017.41
5.6.160.0120.04217.47
5.6.150.0060.03116.43
5.6.140.0030.02416.53
5.6.130.0050.02216.36
5.6.120.0120.04617.80
5.6.110.0080.04317.76
5.6.100.0130.04117.74
5.6.90.0060.02817.63
5.6.80.0050.04817.32
5.6.70.0030.01414.40
5.6.60.0030.01014.34
5.6.50.0040.00814.70
5.6.40.0000.01614.48
5.6.30.0000.01414.36
5.6.20.0070.01014.66
5.6.10.0060.00614.44
5.6.00.0040.01114.55
5.5.380.0060.00914.64
5.5.370.0100.00014.73
5.5.360.0070.00414.68
5.5.350.1450.01817.57
5.5.340.0100.04216.15
5.5.330.0070.02317.49
5.5.320.0150.02217.45
5.5.310.0160.02417.43
5.5.300.0070.04516.23
5.5.290.0070.03816.30
5.5.280.0100.02217.49
5.5.270.0080.04217.70
5.5.260.0100.03217.68
5.5.250.0050.03717.44
5.5.240.0060.04717.44
5.5.230.0090.00014.52
5.5.220.0030.00814.41
5.5.210.0070.01014.16
5.5.200.0070.01114.53
5.5.190.0060.00614.40
5.5.180.0030.01514.61
5.5.170.0140.00314.33
5.5.160.0090.00614.41
5.5.150.0000.01714.50
5.5.140.0110.00314.68
5.5.130.0050.00514.55
5.5.120.0030.00914.49
5.5.110.0060.00614.53
5.5.100.0040.01214.62
5.5.90.0070.00314.37
5.5.80.0000.01314.30
5.5.70.0040.00714.50
5.5.60.0030.01214.37
5.5.50.0060.00614.27
5.5.40.0000.01314.37
5.5.30.0040.01214.60
5.5.20.0030.00914.17
5.5.10.0050.00514.20
5.5.00.0090.00314.23
5.4.450.0490.02915.63
5.4.440.0310.03315.68
5.4.430.0370.03015.69
5.4.420.0420.02515.60
5.4.410.0130.02515.60
5.4.400.0270.03515.49
5.4.390.0350.02915.51
5.4.380.0150.02615.16
5.4.370.0480.02115.25
5.4.360.0400.02815.18
5.4.350.0080.02411.95
5.4.340.0080.02111.94
5.4.330.0050.00511.84
5.4.320.0070.02112.19
5.4.310.0080.02112.19
5.4.300.0050.02312.19
5.4.290.0050.02112.19
5.4.280.0080.01812.13
5.4.270.0060.02312.14
5.4.260.0060.02512.14
5.4.250.0040.02612.13
5.4.240.0040.02212.13
5.4.230.0040.02212.13
5.4.220.0040.02312.13
5.4.210.0050.01912.13
5.4.200.0030.02412.13
5.4.190.0030.02212.13
5.4.180.0030.02112.13
5.4.170.0050.02212.14
5.4.160.0060.02012.13
5.4.150.0090.02312.13
5.4.140.0030.02611.97
5.4.130.0060.02011.96
5.4.120.0060.02111.95
5.4.110.0020.02611.95
5.4.100.0020.02411.95
5.4.90.0060.02311.95
5.4.80.0030.02411.94
5.4.70.0040.02611.94
5.4.60.0060.02011.94
5.4.50.0080.02211.94
5.4.40.0060.02011.93
5.4.30.0040.02411.93
5.4.20.0030.02211.93
5.4.10.0020.02411.93
5.4.00.0060.01911.68
5.3.290.0060.02412.32
5.3.280.0080.02212.28
5.3.270.0050.02312.29
5.3.260.0050.02112.28
5.3.250.0070.02312.28
5.3.240.0070.02412.28
5.3.230.0060.02312.28
5.3.220.0060.02312.26
5.3.210.0070.02412.26
5.3.200.0050.02612.26
5.3.190.0070.02312.26
5.3.180.0070.02012.26
5.3.170.0070.02112.26
5.3.160.0070.02012.26
5.3.150.0070.02612.26
5.3.140.0030.02312.26
5.3.130.0030.02512.25
5.3.120.0050.02312.25
5.3.110.0060.02312.25
5.3.100.0060.02011.99
5.3.90.0070.02011.99
5.3.80.0040.02311.98
5.3.70.0060.02711.98
5.3.60.0090.02211.97
5.3.50.0070.02111.95
5.3.40.0020.02911.95
5.3.30.0060.02311.93
5.3.20.0070.02311.82
5.3.10.0080.02211.80
5.3.00.0040.02511.79
5.2.170.0040.0359.25
5.2.160.0070.0319.25
5.2.150.0050.0359.25
5.2.140.0030.0379.25
5.2.130.0040.0329.21
5.2.120.0040.0299.21
5.2.110.0050.0289.21
5.2.100.0050.0299.21
5.2.90.0030.0309.20
5.2.80.0040.0419.20
5.2.70.0090.0329.20
5.2.60.0060.0329.15
5.2.50.0040.0329.13
5.2.40.0050.0299.10
5.2.30.0070.0339.07
5.2.20.0070.0289.07
5.2.10.0060.0278.97
5.2.00.0070.0278.83
5.1.60.0060.0278.11
5.1.50.0030.0258.10
5.1.40.0050.0348.08
5.1.30.0030.0318.43
5.1.20.0040.0418.45
5.1.10.0070.0358.18
5.1.00.0080.0238.18
5.0.50.0030.0226.66
5.0.40.0040.0196.52
5.0.30.0030.0326.34
5.0.20.0040.0196.30
5.0.10.0040.0206.28
5.0.00.0040.0306.27
4.4.90.0050.0134.78
4.4.80.0030.0154.75
4.4.70.0050.0154.75
4.4.60.0030.0154.75
4.4.50.0020.0164.77
4.4.40.0020.0264.71
4.4.30.0030.0154.76
4.4.20.0020.0164.85
4.4.10.0040.0144.85
4.4.00.0030.0254.76
4.3.110.0030.0164.67
4.3.100.0020.0164.66
4.3.90.0040.0144.64
4.3.80.0020.0254.59
4.3.70.0030.0164.63
4.3.60.0050.0134.63
4.3.50.0030.0164.62
4.3.40.0030.0254.54
4.3.30.0020.0173.30
4.3.20.0020.0163.28
4.3.10.0000.0183.24
4.3.00.0130.0208.44

preferences:
51.47 ms | 401 KiB | 5 Q