3v4l.org

run code in 300+ PHP versions simultaneously
<?php spl_autoload_register(function ($c) { if ('ChildClass' === $c) { class ChildClass extends ParentClass {} } if ('ParentClass' === $c) { throw new \Exception('ParentClass not found.'); } }); try { new ChildClass(); } catch (\Exception $e) { echo $e->getMessage(); }

preferences:
56.85 ms | 402 KiB | 5 Q