- get_object_vars: documentation ( source)
<?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();