3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo extends Exception { public function __construct() { var_dump('constructed'); } } assert(false, new Foo());
based on 14oZ0
Output for 7.0.0 - 7.2.0
string(11) "constructed" Warning: assert(): Foo in /in/GU50j:9 Stack trace: #0 {main} failed in /in/GU50j on line 9
Output for 5.4.8 - 5.6.28
string(11) "constructed" Warning: assert(): exception 'Foo' in /in/GU50j:9 Stack trace: #0 {main} failed in /in/GU50j on line 9
Output for 5.3.18 - 5.4.7
string(11) "constructed" Warning: assert() expects exactly 1 parameter, 2 given in /in/GU50j on line 9