- var_dump: documentation ( source)
<?php
class test {
private $f;
public function __construct(&$f) {
$this->f = &$f;
}
public function __destruct() {
$this->f = 1;
}
}
$f = function () use (&$f) {
$t = new test($f);
print "After this line it the Closure should be destroyed...";
};
$f();
var_dump($f);