3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface MyException { } class ImplementingException1 extends \Exception implements MyException { } class ImplementingException2 extends \Exception implements MyException { } function test($var) { if ($var) throw new ImplementingException1; throw new ImplementingException2; } try { test(true); } catch (MyException $e) { get_class($e); }
based on maGsp
Output for 5.3.18 - 7.2.0