- var_dump: documentation ( source)
<?php
class C
{
public $p;
public function &__get($n)
{
return $this->p;
}
}
$first = new C;
$first->p = 'init';
$clone = clone $first;
$clone->p = $first->magic;
$clone = clone $first;
$clone->p = 'foo';
var_dump($first->v);