3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function baz($a){ unset($a); echo "2\n"; var_dump(func_get_args()); }; echo "1\n"; baz(new class(){ function __destruct(){ echo "destruct\n"; }}); echo "3\n";
based on pq97E
Output for 7.1.10 - 7.2.6
1 destruct 2 array(1) { [0]=> NULL } 3
Output for 7.0.0 - 7.1.7
1 destruct 2 array(0) { } 3
Output for 5.5.0 - 5.6.28
Parse error: syntax error, unexpected 'class' (T_CLASS) in /in/3l7ps on line 9
Process exited with code 255.