3v4l.org

run code in 300+ PHP versions simultaneously
<?php function createDateFromFormat($format, $time) { $result = \DateTimeImmutable::createFromFormat($format, $time); if (!$result || \DateTimeImmutable::getLastErrors()['warning_count']) { return false; } return $result; } var_dump(\DateTime::createFromFormat('Y-m-d', '2005-12-1')); var_dump(\DateTime::createFromFormat('Y-m-d', '2005')); // should be false var_dump(\DateTime::createFromFormat('Y-m-d', '0-0-0')); // should be false var_dump(\DateTimeImmutable::createFromFormat('Y-m-d', '2005-12-1')); var_dump(\DateTimeImmutable::createFromFormat('Y-m-d', '2005')); // should be false var_dump(\DateTimeImmutable::createFromFormat('Y-m-d', '0-0-0')); // should be false var_dump(get_class(createDateFromFormat('Y-m-d', '2005-12-1'))); var_dump(get_class(createDateFromFormat('Y-m-d', '2005'))); // should be false var_dump(createDateFromFormat('Y-m-d', '0-0-0')); // should be false

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.0040.01118.68
8.3.50.0120.00916.63
8.3.40.0120.00318.86
8.3.30.0120.00318.94
8.3.20.0000.00820.38
8.3.10.0000.00921.89
8.3.00.0080.00020.79
8.2.180.0150.00318.25
8.2.170.0050.01022.96
8.2.160.0100.00322.18
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0050.00222.30
8.2.120.0000.00826.35
8.2.110.0090.00020.53
8.2.100.0090.00318.15
8.2.90.0060.00319.36
8.2.80.0030.00618.05
8.2.70.0060.00317.88
8.2.60.0000.00818.16
8.2.50.0040.00418.10
8.2.40.0040.00720.21
8.2.30.0040.00421.08
8.2.20.0040.00418.20
8.2.10.0000.00818.20
8.2.00.0000.00818.22
8.1.280.0120.00325.92
8.1.270.0040.00423.70
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0060.00322.60
8.1.230.0000.01119.05
8.1.220.0050.00317.74
8.1.210.0000.00918.77
8.1.200.0040.00417.47
8.1.190.0060.00317.47
8.1.180.0040.00418.10
8.1.170.0080.00018.64
8.1.160.0000.00719.15
8.1.150.0000.00820.64
8.1.140.0040.00419.70
8.1.130.0050.00318.89
8.1.120.0080.00317.65
8.1.110.0000.00717.50
8.1.100.0040.00417.52
8.1.90.0040.00417.63
8.1.80.0030.00517.50
8.1.70.0000.00717.64
8.1.60.0060.00317.69
8.1.50.0050.00317.56
8.1.40.0080.00017.58
8.1.30.0040.00417.71
8.1.20.0040.00417.75
8.1.10.0030.00517.60
8.1.00.0040.00417.66
8.0.300.0000.00818.77
8.0.290.0040.00416.88
8.0.280.0070.00018.54
8.0.270.0000.00817.28
8.0.260.0030.00317.14
8.0.250.0000.00717.21
8.0.240.0070.00017.05
8.0.230.0030.00617.19
8.0.220.0000.00717.16
8.0.210.0000.00717.19
8.0.200.0030.00317.11
8.0.190.0040.00417.16
8.0.180.0080.00017.12
8.0.170.0040.00417.19
8.0.160.0070.00017.10
8.0.150.0000.00717.09
8.0.140.0040.00417.15
8.0.130.0050.00313.50
8.0.120.0000.00917.15
8.0.110.0040.00417.03
8.0.100.0040.00417.24
8.0.90.0080.00017.17
8.0.80.0120.00417.22
8.0.70.0040.00417.20
8.0.60.0050.00217.17
8.0.50.0000.00817.00
8.0.30.0130.00617.38
8.0.20.0090.01017.40
8.0.10.0030.00517.19
8.0.00.0080.01117.11
7.4.330.0050.00015.55
7.4.320.0030.00316.64
7.4.300.0000.00616.61
7.4.290.0070.00016.59
7.4.280.0040.00416.61
7.4.270.0000.00716.71
7.4.260.0040.00416.48
7.4.250.0000.00716.67
7.4.240.0070.00016.71
7.4.230.0030.00316.68
7.4.220.0200.00716.80
7.4.210.0060.01016.77
7.4.200.0070.00016.80
7.4.160.0060.01016.58
7.4.150.0140.00417.40
7.4.140.0090.01117.86
7.4.130.0160.01216.68
7.4.120.0080.01016.63
7.4.110.0100.01016.50
7.4.100.0080.01216.54
7.4.90.0120.00616.50
7.4.80.0080.01719.39
7.4.70.0110.00616.64
7.4.60.0070.01016.86
7.4.50.0070.00316.72
7.4.40.0120.01216.79
7.4.30.0130.00316.59
7.4.00.0030.00915.36
7.3.330.0030.00313.50
7.3.320.0000.00513.52
7.3.310.0070.00016.54
7.3.300.0040.00216.46
7.3.290.0000.00716.48
7.3.280.0090.00816.46
7.3.270.0140.00717.40
7.3.260.0120.00716.72
7.3.250.0120.00816.53
7.3.240.0150.00616.69
7.3.230.0090.00916.75
7.3.210.0040.01516.71
7.3.200.0090.01216.67
7.3.190.0070.01016.48
7.3.180.0100.00716.68
7.3.170.0070.01016.49
7.3.160.0030.01316.68
7.2.330.0120.00616.60
7.2.320.0070.01116.88
7.2.310.0140.01016.71
7.2.300.0100.01016.74
7.2.290.0060.01216.98
7.2.60.0030.01316.79
7.2.00.0000.01119.78
7.1.200.0040.01115.81
7.1.100.0030.01318.17
7.1.70.0040.00417.35
7.1.60.0500.01033.15
7.1.50.0500.01732.95
7.1.40.0800.01332.75
7.1.30.1030.00732.66
7.1.20.0730.01733.17
7.1.10.0470.00314.88
7.1.00.0370.01315.12
7.0.200.0530.00314.83
7.0.190.0470.00715.10
7.0.180.0600.01014.50
7.0.170.0700.01314.50
7.0.160.0730.00314.61
7.0.150.0400.01014.46
7.0.140.0400.01014.52
7.0.130.0470.00714.72
7.0.120.0430.01014.69
7.0.110.0430.01014.57
7.0.100.0430.00314.68
7.0.90.0430.00314.51
7.0.80.0400.00714.63
7.0.70.0730.00314.48
7.0.60.0370.01014.38
7.0.50.0700.00714.73
7.0.40.0570.01014.62
7.0.30.0570.01314.70
7.0.20.0470.00714.79
7.0.10.0400.01014.39
7.0.00.0370.01014.50

preferences:
35.2 ms | 401 KiB | 5 Q