- get_object_vars: documentation ( source)
<?php
function with($o) {
return $o;
}
class Foo {
function getSets() {
return ['pizza'=>'bar'];
}
}
class Bar {
public $controller;
function __construct() {
$this->controller = new Foo;
}
function test() {
echo with((object)with((object)get_object_vars($this))->controller->getSets())->pizza;
}
}
$b = new Bar;
$b->test();