3v4l.org

run code in 300+ PHP versions simultaneously
<?php try { $tz = new DateTimeZone('Invalid timezone'); } catch (\Exception $exception) { echo "Invalid time zone (error: " . $exception->getMessage() . ")\n"; $tz = null; } var_dump($tz);

preferences:
27.76 ms | 402 KiB | 5 Q