3v4l.org

run code in 500+ PHP versions simultaneously
<?php try { DateInterval::createFromDateString('FAIL'); } catch (Exception $e) { var_dump($e::class); var_dump($e instanceof DateMalformedStringException); }
Output for 8.3.0 - 8.3.37, 8.4.1 - 8.4.28, 8.5.0 - 8.5.13, 8.6.0
string(36) "DateMalformedIntervalStringException" bool(false)
Output for 8.2.31 - 8.2.36
Warning: DateInterval::createFromDateString(): Unknown or bad format (FAIL) at position 0 (F): The timezone could not be found in the database in /in/EF631 on line 4

preferences:
18.72 ms | 1167 KiB | 6 Q