3v4l.org

run code in 300+ PHP versions simultaneously
<?php try { new PDO("invalid"); } catch (RuntimeException $e) { $code = $e->getCode(); var_dump($code); }
Output for 7.4.0 - 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.29, 8.2.0 - 8.2.20, 8.3.0 - 8.3.8
int(0)

preferences:
125.57 ms | 402 KiB | 126 Q