3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyDateTime extends DateTime { public static function createFromFormat($format, $time, $timezone = null) { $version = explode('.', phpversion()); if(!$timezone) $timezone = new DateTimeZone(date_default_timezone_get()); if(((int)$version[0] >= 5 && (int)$version[1] >= 2 && (int)$version[2] > 17)){ return parent::createFromFormat($format, $time, $timezone); } return new DateTime(date($format, strtotime($time)), $timezone); } } $dateTime = MyDateTime::createFromFormat('Y-m-d', '2013-6-13'); var_dump($dateTime); var_dump($dateTime->format('Y-m-d'));

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.1.20.0050.00717.70
8.0.150.0030.00616.91
8.0.10.0330.00717.15
8.0.00.0280.00917.27
7.4.140.0380.00616.48
7.4.130.0230.01216.70
7.4.120.0450.00816.77
7.4.110.0230.01016.73
7.4.100.0300.00416.56
7.4.90.0240.01716.73
7.4.80.0470.01416.55
7.4.70.0290.00416.72
7.4.60.0350.00516.68
7.4.50.0170.01716.56
7.4.40.0190.01216.54
7.4.30.0220.00916.64
7.4.20.0180.00916.38
7.4.10.0120.01616.55
7.4.00.0240.01416.76
7.3.260.0070.01016.84
7.3.250.0120.02016.55
7.3.240.0290.00416.48
7.3.230.0230.01216.54
7.3.220.0340.00316.70
7.3.210.0830.02716.60
7.3.200.0330.00916.80
7.3.190.0460.02216.55
7.3.180.0290.00716.55
7.3.170.0200.00416.51
7.3.160.0230.00816.37
7.3.150.0220.00416.55
7.3.140.0270.00716.67
7.3.130.0210.01216.43
7.3.120.0240.00416.31
7.3.110.0190.01216.38
7.3.100.0210.00416.50
7.3.90.0180.00915.90
7.3.80.0200.00816.39
7.3.70.0170.01416.22
7.3.60.0120.01216.31
7.3.50.0130.01716.50
7.3.40.0210.00916.43
7.3.30.0150.01216.12
7.3.20.0180.00916.57
7.3.10.0320.00716.70
7.3.00.0160.00816.54
7.2.340.0230.01017.02
7.2.330.0720.02116.62
7.2.320.0300.00716.61
7.2.310.0290.00816.85
7.2.300.0240.03116.97
7.2.290.0170.02016.59
7.2.280.0180.01517.00
7.2.270.0280.01216.59
7.2.260.0280.01117.07
7.2.250.0350.00416.77
7.2.240.0270.00616.80
7.2.230.0590.00716.90
7.2.220.0310.00816.59
7.2.210.0190.01617.09
7.2.200.0270.01416.77
7.2.190.0350.00316.69
7.2.180.0230.01516.80
7.2.170.0300.01016.61
7.2.160.0340.01516.91
7.2.150.0310.00316.89
7.2.140.0320.01316.77
7.2.130.0230.00316.97
7.2.120.0160.00916.94
7.2.110.0240.00716.99
7.2.100.0160.00717.02
7.2.90.0320.01017.05
7.2.80.0160.00816.85
7.2.70.0170.01016.87
7.2.60.0120.01216.88
7.2.50.0150.01417.03
7.2.40.0150.01116.99
7.2.30.0210.00517.03
7.2.20.0140.01017.00
7.2.10.0150.01116.92
7.2.00.0160.00417.72
7.1.330.0190.01215.91
7.1.320.0250.01315.89
7.1.310.0330.00915.98
7.1.300.0860.00315.72
7.1.290.0340.00315.77
7.1.280.0290.00415.76
7.1.270.0210.01415.80
7.1.260.0180.01815.82
7.1.250.0160.00615.84
7.1.240.0150.00815.67
7.1.230.0140.00615.84
7.1.220.0170.00815.78
7.1.210.0150.00715.77
7.1.200.0150.01115.71
7.1.190.0250.01615.89
7.1.180.0180.00415.74
7.1.170.0140.01415.83
7.1.160.0200.00315.96
7.1.150.0190.00515.83
7.1.140.0150.00615.89
7.1.130.0190.00615.71
7.1.120.0150.00715.76
7.1.110.0220.00815.95
7.1.100.0090.01016.69
7.1.90.0160.00816.03
7.1.80.0120.01015.90
7.1.70.0100.01116.39
7.1.60.0170.00216.42
7.1.50.0090.01016.46
7.1.40.0130.00716.25
7.1.30.0120.01516.15
7.1.20.0150.00516.29
7.1.10.0120.01016.23
7.1.00.0120.00616.25
7.0.330.0170.00315.40
7.0.320.0150.00915.41
7.0.310.0130.00815.39
7.0.300.0140.00915.30
7.0.290.0150.00715.55
7.0.280.0210.00515.47
7.0.270.0250.00915.38
7.0.260.0160.00815.34
7.0.250.0110.01115.49
7.0.240.0150.00615.54
7.0.230.0160.00515.41
7.0.220.0160.00315.32
7.0.210.0140.01015.39
7.0.200.0090.00916.06
7.0.190.0160.00415.93
7.0.180.0100.00715.71
7.0.170.0170.00815.71
7.0.160.0110.00815.80
7.0.150.0100.00815.61
7.0.140.0120.00815.79
7.0.130.0150.00515.89
7.0.120.0130.00815.94
7.0.110.0080.01115.82
7.0.100.0140.00615.92
7.0.90.0070.01215.78
7.0.80.0120.00415.76
7.0.70.0090.00915.91
7.0.60.0080.01015.75
7.0.50.0080.01015.78
7.0.40.0140.00514.51
7.0.30.0570.00714.60
7.0.20.0150.00614.61
7.0.10.0110.00814.51
7.0.00.0120.00814.63
5.6.400.0270.00816.01
5.6.390.0270.00816.21
5.6.380.0100.01115.02
5.6.370.0120.01115.07
5.6.360.0140.01015.15
5.6.350.0090.01515.10
5.6.340.0170.00515.05
5.6.330.0120.00915.26
5.6.320.0170.00515.16
5.6.310.0130.01015.36
5.6.300.0120.02117.19
5.6.290.0110.02217.19
5.6.280.0100.02317.35
5.6.270.0100.01917.19
5.6.260.0120.01917.15
5.6.250.0120.02017.21
5.6.240.0120.01817.19
5.6.230.0070.02317.17
5.6.220.0110.02416.97
5.6.210.0130.01817.18
5.6.200.0080.02417.15
5.6.190.0140.02817.29
5.6.180.0080.02617.19
5.6.170.0130.01917.17
5.6.160.0130.01917.31
5.6.150.0130.02217.39
5.6.140.0110.02517.14
5.6.130.0100.02117.23
5.6.120.0120.02117.04
5.6.110.0130.01917.16
5.6.100.0090.02117.05
5.6.90.0120.01817.09
5.6.80.0130.01816.91
5.6.70.0100.02116.87
5.6.60.0120.01916.83
5.6.50.0130.02116.90
5.6.40.0170.02917.00
5.6.30.0130.01916.92
5.6.20.0100.03616.89
5.6.10.0120.02117.00
5.6.00.0070.02516.87
5.5.380.0100.02015.13
5.5.370.0110.02015.24
5.5.360.0130.02215.17
5.5.350.0110.02115.18
5.5.340.0130.01615.36
5.5.330.0120.02215.33
5.5.320.0120.02215.31
5.5.310.0090.02415.23
5.5.300.0110.02215.33
5.5.290.0140.02415.30
5.5.280.0110.02115.33
5.5.270.0080.02115.29
5.5.260.0100.02115.37
5.5.250.0150.01715.21
5.5.240.0100.01715.12
5.5.230.0130.01915.00
5.5.220.0090.01915.02
5.5.210.0100.02515.17
5.5.200.0080.01815.04
5.5.190.0180.02115.09
5.5.180.0120.01915.06
5.5.170.0220.01013.94
5.5.160.0120.02015.02
5.5.150.0120.02015.10
5.5.140.0120.01815.10
5.5.130.0130.01715.11
5.5.120.0100.02215.06
5.5.110.0120.01915.07
5.5.100.0070.02314.88
5.5.90.0100.01914.97
5.5.80.0110.02215.04
5.5.70.0050.02614.99
5.5.60.0110.01915.04
5.5.50.0120.01815.09
5.5.40.0100.02115.11
5.5.30.0080.02115.07
5.5.20.0100.01915.05
5.5.10.0160.01915.09
5.5.00.0100.02415.04
5.4.450.0060.02614.70
5.4.440.0050.02214.64
5.4.430.0150.03314.72
5.4.420.0090.01614.71
5.4.410.0080.01714.63
5.4.400.0110.01514.52
5.4.390.0090.02014.57
5.4.380.0090.02114.51
5.4.370.0140.01214.53
5.4.360.0090.01814.50
5.4.350.0140.01814.48
5.4.340.0090.01614.50
5.4.330.0110.00812.27
5.4.320.0080.02214.51
5.4.310.0050.01914.46
5.4.300.0130.01814.53
5.4.290.0210.01414.53
5.4.280.0080.02114.50
5.4.270.0110.01814.55
5.4.260.0110.01714.53
5.4.250.0110.01814.53
5.4.240.0100.01914.41
5.4.230.0130.01614.53
5.4.220.0080.01814.59
5.4.210.0110.01614.47
5.4.200.0070.01914.43
5.4.190.0080.01814.57
5.4.180.0080.02014.48
5.4.170.0140.01414.58
5.4.160.0110.01614.50
5.4.150.0090.01814.48
5.4.140.0130.01613.70
5.4.130.0090.01613.83
5.4.120.0070.02013.77
5.4.110.0080.01813.79
5.4.100.0110.01613.79
5.4.90.0100.01713.73
5.4.80.0090.01713.70
5.4.70.0050.01913.76
5.4.60.0100.01613.72
5.4.50.0040.02313.79
5.4.40.0110.01313.75
5.4.30.0080.01813.62
5.4.20.0120.01513.74
5.4.10.0150.01913.75
5.4.00.0080.01713.56
5.3.290.0120.01613.38
5.3.280.0130.01713.36
5.3.270.0100.01813.34
5.3.260.0140.01513.29
5.3.250.0100.01813.30
5.3.240.0100.03213.29
5.3.230.0080.01813.29
5.3.220.0060.02113.20
5.3.210.0060.02013.22
5.3.200.0080.02013.22
5.3.190.0080.02013.27
5.3.180.0100.01413.32
5.3.170.0120.02113.34
5.3.160.0100.01713.30
5.3.150.0090.02313.32
5.3.140.0100.01713.37
5.3.130.0060.02013.24
5.3.120.0110.01713.29
5.3.110.0130.01313.29
5.3.100.0080.01913.28
5.3.90.0090.01613.26
5.3.80.0080.01813.24
5.3.70.0080.01813.22
5.3.60.0090.01513.33
5.3.50.0060.02413.27
5.3.40.0100.01513.28
5.3.30.0190.01813.34
5.3.20.0100.01513.30
5.3.10.0060.02013.24
5.3.00.0150.01713.21
5.2.170.0040.01612.99
5.2.160.0060.01412.99
5.2.150.0050.01612.95
5.2.140.0060.01512.93
5.2.130.0040.02012.91
5.2.120.0060.01412.91
5.2.110.0110.01012.91
5.2.100.0070.01512.95
5.2.90.0070.01412.93
5.2.80.0080.01212.91
5.2.70.0080.01612.91
5.2.60.0130.01112.91
5.2.50.0050.01812.91
5.2.40.0070.02512.91
5.2.30.0080.01712.91
5.2.20.0080.01512.91
5.2.10.0090.01212.91
5.2.00.0080.01312.91
5.1.60.0080.00912.91
5.1.50.0070.01112.91
5.1.40.0050.01112.91
5.1.30.0100.01112.91
5.1.20.0050.01412.91
5.1.10.0070.01012.91
5.1.00.0050.01312.91
5.0.50.0060.01012.91
5.0.40.0060.00712.91
5.0.30.0030.01512.91
5.0.20.0040.01212.91
5.0.10.0040.01212.91
5.0.00.0080.01112.91
4.4.90.0020.00912.91
4.4.80.0040.00712.91
4.4.70.0050.00612.91
4.4.60.0040.00612.91
4.4.50.0040.00912.91
4.4.40.0020.01212.91
4.4.30.0060.00712.91
4.4.20.0070.00812.91
4.4.10.0050.00712.91
4.4.00.0020.01112.91
4.3.110.0070.00612.91
4.3.100.0030.00812.91
4.3.90.0050.00612.91
4.3.80.0050.00912.91
4.3.70.0040.00812.91
4.3.60.0020.00812.91
4.3.50.0030.00812.91
4.3.40.0020.01112.91
4.3.30.0040.00712.91
4.3.20.0020.00812.91
4.3.10.0040.00812.91
4.3.00.0040.00812.91

preferences:
12.09 ms | 406 KiB | 5 Q