- var_dump: documentation ( source)
<?php
class Foo {
public function __construct(private string $value) {}
public function __destruct() {
var_dump($this->value);
}
}
function test() {
$a = new Foo('a');
$b = new Foo('b');
$c = new Foo('c');
print "Destructor order:\n";
}
test();