- var_export: documentation ( source)
<?php
class Foo {
protected $values = [];
public function __get($name) {
return $this->values[$name];
}
public function __construct($name) {
$this->values['bar'] = $name;
}
}
$foo = new Foo('asdf');
var_export($foo->bar);