mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Add destructor inheritance test (bug #24637)
This commit is contained in:
parent
2bbf4ad261
commit
f427dc4f8e
1 changed files with 29 additions and 0 deletions
29
tests/classes/destructor_inheritance.phpt
Executable file
29
tests/classes/destructor_inheritance.phpt
Executable file
|
@ -0,0 +1,29 @@
|
|||
--TEST--
|
||||
ZE2 The inherited destructor is called
|
||||
--SKIPIF--
|
||||
<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
class base {
|
||||
function __construct() {
|
||||
echo __METHOD__ . "\n";
|
||||
}
|
||||
|
||||
function __destruct() {
|
||||
echo __METHOD__ . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
class derived extends base {
|
||||
}
|
||||
|
||||
$obj = new derived;
|
||||
|
||||
unset($obj);
|
||||
|
||||
echo 'Done';
|
||||
?>
|
||||
--EXPECT--
|
||||
base::__construct
|
||||
base::__destruct
|
||||
Done
|
Loading…
Add table
Add a link
Reference in a new issue