3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class T { public $foobar = '123456'; } $a = new T(); $attrs = ['foo' => 'foobar']; echo $a->$attrs['foo'];
based on hIXS6
Output for 7.0.0 - 7.2.0
Notice: Array to string conversion in /in/daj11 on line 8 Notice: Undefined property: T::$Array in /in/daj11 on line 8
Output for 5.4.9 - 5.6.28
123456
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/daj11 on line 6
Process exited with code 255.