3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { function getSets() { return ['pizza'=>'bar']; } } class Bar { public $controller; function __construct() { $this->controller = new Foo; } function test echo ((object)((object)get_object_vars($this))->controller->getSets())->pizza; } } $b = new Bar; $b->test();
Output for 5.4.0 - 5.4.18
Parse error: syntax error, unexpected 'echo' (T_ECHO), expecting '(' in /in/O5DNK on line 15
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected '[' in /in/O5DNK on line 5
Process exited with code 255.