- var_dump: documentation ( source)
<?php
class DataCollector {
protected $dataObj;
public function __construct() { $this->dataObj = new stdClass(); }
public function __set( $name, $value ) {
$this->dataObj->name = $value;
}
}
$test = new stdClass();
$test->cake = 'hi';
$DataCollector = new DataCollector();
$DataCollector->node = $test;
$DataCollector->node->cake = 'bye';
var_dump( $DataCollector );