php-src/tests/classes/destructor_visibility_003.phpt
Gabriel Caruso ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00

27 lines
382 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
?>
===DONE===
--EXPECT--
Derived::__destruct
===DONE===