3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class myexception extends Exception { public function __construct($message, Throwable $previous = null) { parent::__construct($message, 0, $previous); } } $standardException = new Exception('standard Exception'); $myexception = new myexception('first without throwable'); $myexception = new myexception('second with throwable', $standardException);
based on MLiYA
Output for hhvm-3.18.5 - 3.22.0, 7.0.0 - 7.3.0beta1
Output for 5.6.0 - 5.6.30
Catchable fatal error: Argument 2 passed to myexception::__construct() must be an instance of Throwable, instance of Exception given, called in /in/KN4lL on line 13 and defined in /in/KN4lL on line 4
Process exited with code 255.