mirror of
https://github.com/php/php-src.git
synced 2024-12-18 14:30:35 +08:00
28 lines
449 B
PHP
Executable File
28 lines
449 B
PHP
Executable File
--TEST--
|
|
Bug #36759 (Objects destructors are invoked in wrong order when script is finished)
|
|
--FILE--
|
|
<?php
|
|
class Foo {
|
|
private $bar;
|
|
function __construct($bar) {
|
|
$this->bar = $bar;
|
|
}
|
|
function __destruct() {
|
|
echo __METHOD__,"\n";
|
|
unset($this->bar);
|
|
}
|
|
}
|
|
|
|
class Bar {
|
|
function __destruct() {
|
|
echo __METHOD__,"\n";
|
|
unset($this->bar);
|
|
}
|
|
}
|
|
$y = new Bar();
|
|
$x = new Foo($y);
|
|
?>
|
|
--EXPECT--
|
|
Foo::__destruct
|
|
Bar::__destruct
|