- Output for 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
- object(TestClass)#1 (0) { } Destructor for TestClass
<?php
class TestClass {
public function __construct() {
return new stdClass();
}
public function __destruct() {
echo 'Destructor for ', __CLASS__, PHP_EOL;
}
}
$o = new TestClass(20);
var_dump($o);