3v4l.org

run code in 300+ PHP versions simultaneously
<?php class myCustomException extends Exception { } class someClass { public function __call($name, $arguments) { if (!method_exists($this, $name)) { throw new myCustomException($name . ' has shuffled the mortal coil'); } } } $someObject = new someClass(); try { $someObject->someMethodTheObjectDoesntProvide(); } catch (myCustomException $e) { echo $e->getMessage(); }

preferences:
30.48 ms | 404 KiB | 5 Q