3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = new class { public $foo = 'foo'; }; function change($a) { $a->foo = 'bar'; } change($a); echo $a->foo;
based on 69Qf7
Output for hhvm-3.18.5 - 3.22.0, 7.1.0 - 7.2.6
bar
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected 'class' (T_CLASS) in /in/vsf4s on line 3
Process exited with code 255.