mirror of
https://github.com/php/php-src.git
synced 2025-01-08 20:17:28 +08:00
28 lines
449 B
Plaintext
28 lines
449 B
Plaintext
|
--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
|