mirror of
https://github.com/php/php-src.git
synced 2024-12-28 11:20:29 +08:00
29 lines
491 B
PHP
Executable File
29 lines
491 B
PHP
Executable File
--TEST--
|
|
ZE2 Ensuring destructor visibility
|
|
--SKIPIF--
|
|
<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
|
|
--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===
|
|
--EXPECTF--
|
|
Derived::__destruct
|
|
===DONE===
|