3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class MyException extends Exception { public function __construct($message, $code=0, Exception $previous = null) { parent::__construct($message,$code,$previous); } public function __toString() { return __CLASS__. ":[{$this->code}]:{$this->message}\n"; } } $e = new Exception("Bar"); throw new MyException("Foo", "123", $e);
based on 7EktO
Output for 5.3.21 - 7.2.0
Fatal error: Uncaught MyException:[123]:Foo thrown in /in/OGPC6 on line 13
Process exited with code 255.