3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = [ 'bar', 'baz' ]; class Foo { public $bar = 'zzz'; } var_dump((new Foo)->$a[0]);
based on 556DL
Output for 7.0.0 - 7.3.0rc2
Notice: Array to string conversion in /in/X9UQX on line 8 Notice: Undefined property: Foo::$Array in /in/X9UQX on line 8 NULL
Output for hhvm-3.15.4
Fatal error: Uncaught Error: syntax error, unexpected '[', expecting ')' in /in/X9UQX:8 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
string(3) "zzz"