3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = '1990-09-15'; // $input = '15-09-1990'; // $input = '1990-49-85'; $a = DateTime::createFromFormat('Y-m-d', $input); if ($a === false) { echo "Invalid format\n"; } $lastError = DateTime::getLastErrors()['warnings'] ?? []; if (reset($lastError) === 'The parsed date was invalid') { echo "Invalid date\n"; }

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.5.00.0140.00720.33
8.4.150.0180.00316.73
8.4.140.0130.00917.77
8.4.130.0130.00719.73
8.4.120.0070.00520.70
8.4.110.0120.00718.95
8.4.100.0110.00918.88
8.4.90.0120.00720.64
8.4.80.0100.00918.98
8.4.70.0050.00918.18
8.4.60.0220.00817.81
8.4.50.0110.01017.97
8.3.280.0010.00114.05
8.3.270.0100.01016.73
8.3.260.0140.00616.65
8.3.250.0120.00617.05
8.3.240.0080.01016.56
8.3.230.0070.00816.50
8.3.220.0030.00618.70
8.3.210.0040.00416.47
8.3.200.0090.01016.66
8.3.190.0090.01016.40
8.3.180.0120.00616.49
8.3.50.0100.01016.72
8.2.290.0120.00720.39
8.2.280.0120.00716.90

preferences:
50.78 ms | 403 KiB | 5 Q