I'm confused what would happen in this situation:
public function foo() {
$obj = new \stdClass();
$obj->bar = 'foobar';
$this->obj = $obj;
}
If $obj is copied by reference, then when foo() returns, won't $obj be deleted and thus $this->obj point to an object that no longer exists?