- var_dump: documentation ( source)
<?php
class A {
function __construct() {
$this->foo = new B;
}
}
class B {
static $c = 0;
function construct() {
$this->i = ++self::$c;
}
}
$a = new A;
$b = clone $a;
var_dump($a, $b);