php-src/tests/classes/destructor_visibility_003.phpt
2020-02-03 22:52:20 +01:00

25 lines
384 B
PHP

--TEST--
ZE2 Ensuring destructor visibility
--FILE--
<?php
class Base {
private function __destruct() {
echo __METHOD__ . "\n";
}
}
class Derived extends Base {
public function __destruct() {
echo __METHOD__ . "\n";
}
}
$obj = new Derived;
unset($obj); // Derived::__destruct is being called not Base::__destruct
?>
--EXPECT--
Derived::__destruct