3v4l.org

run code in 300+ PHP versions simultaneously
<?php $format = "Y-m-d" $time = "" $timezone = null if(!$timezone) $timezone = new DateTimeZone(date_default_timezone_get()); //Dont use version. This will mess with the tests /*$version = explode('.', phpversion()); if(((int)$version[0] >= 5 && (int)$version[1] >= 2 && (int)$version[2] > 17)){ return parent::createFromFormat($format, $time, $timezone); }*/ $unixTimestamp = strtotime($time); //Return false if there is it is an invalid time /*if($unixTimestamp == false) { return false; }*/ return new DateTime(date($format, $unixTimestamp), $timezone);

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)
5.4.350.0070.03612.01
5.4.340.0070.03512.01
5.4.320.0060.03812.50
5.4.310.0070.04312.49
5.4.300.0090.04412.50
5.4.290.0110.04312.49
5.4.280.0110.04012.39
5.4.270.0100.05012.39
5.4.260.0110.03812.39
5.4.250.0060.05012.39
5.4.240.0090.04812.39
5.4.230.0050.04912.38
5.4.220.0140.07212.38
5.4.210.0140.04412.38
5.4.200.0110.04812.38
5.4.190.0090.04912.38
5.4.180.0080.03612.38
5.4.170.0070.04012.38
5.4.160.0090.04912.38
5.4.150.0090.04912.38
5.4.140.0080.04112.07
5.4.130.0080.03512.05
5.4.120.0060.03712.02
5.4.110.0080.05512.01
5.4.100.0050.04712.01
5.4.90.0090.04212.01
5.4.80.0070.04112.02
5.4.70.0080.03812.01
5.4.60.0060.03612.01
5.4.50.0010.04012.00
5.4.40.0110.03011.99
5.4.30.0090.03611.99
5.4.20.0070.03811.99
5.4.10.0070.03811.99
5.4.00.0040.03711.49
5.3.290.0080.03712.80
5.3.280.0070.03712.71
5.3.270.0090.04412.72
5.3.260.0060.04012.71
5.3.250.0080.03912.72
5.3.240.0060.04412.72
5.3.230.0080.04212.71
5.3.220.0060.04312.68
5.3.210.0040.04612.68
5.3.200.0060.04412.68
5.3.190.0080.04812.68
5.3.180.0080.04112.67
5.3.170.0050.03912.67
5.3.160.0060.03912.68
5.3.150.0060.03812.67
5.3.140.0070.03612.66
5.3.130.0050.04112.66
5.3.120.0080.03812.66
5.3.110.0040.04012.66
5.3.100.0080.04012.12
5.3.90.0080.03812.08
5.3.80.0100.03212.08
5.3.70.0040.03812.07
5.3.60.0070.03512.06
5.3.50.0060.03812.00
5.3.40.0040.03812.00
5.3.30.0050.03611.95
5.3.20.0060.03511.73
5.3.10.0060.03511.70
5.3.00.0060.03611.68
5.2.170.0060.0299.18
5.2.160.0060.0299.18
5.2.150.0100.0259.18
5.2.140.0030.0339.18
5.2.130.0040.0359.14
5.2.120.0090.0309.14
5.2.110.0040.0339.15
5.2.100.0060.0339.14
5.2.90.0060.0369.14
5.2.80.0080.0299.14
5.2.70.0090.0299.13
5.2.60.0040.0319.09
5.2.50.0090.0339.06
5.2.40.0100.0659.04
5.2.30.0080.0279.02
5.2.20.0070.0309.00
5.2.10.0040.0318.92
5.2.00.0060.0338.79
5.1.60.0040.0248.06
5.1.50.0040.0278.06
5.1.40.0060.0238.05
5.1.30.0050.0298.40
5.1.20.0030.0298.42
5.1.10.0070.0228.14
5.1.00.0040.0258.14
5.0.50.0020.0276.63
5.0.40.0030.0246.49
5.0.30.0020.0366.29
5.0.20.0050.0206.26
5.0.10.0070.0216.25
5.0.00.0040.0316.24
4.4.90.0010.0184.78
4.4.80.0030.0174.75
4.4.70.0020.0164.75
4.4.60.0040.0164.75
4.4.50.0030.0204.77
4.4.40.0030.0264.71
4.4.30.0020.0184.76
4.4.20.0020.0164.84
4.4.10.0030.0164.84
4.4.00.0030.0254.76
4.3.110.0030.0154.66
4.3.100.0030.0154.67
4.3.90.0020.0164.63
4.3.80.0070.0234.59
4.3.70.0020.0154.63
4.3.60.0050.0124.63
4.3.50.0020.0164.63
4.3.40.0030.0244.54
4.3.30.0030.0163.29
4.3.20.0010.0163.25
4.3.10.0030.0153.22
4.3.00.0000.0236.49

preferences:
141.96 ms | 1386 KiB | 7 Q