3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $obj = (object) [ 'a' => function(){ return 1; }, 'b' => (object) [ 'ba' => function(){ return 2; }, 'bb' => (object) [ 'bba' => function(){ return 3; } ] ] ]; echo $obj->a->__invoke(); $obj->b->ba->__invoke(); $obj->b->bb->bba->__invoke();
based on r6XjR
Output for 5.4.11 - 7.2.6
1
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/XWNQo on line 3
Process exited with code 255.