mirror of
https://github.com/php/php-src.git
synced 2024-12-21 16:00:18 +08:00
33 lines
564 B
PHP
33 lines
564 B
PHP
--TEST--
|
|
Scoping in destructor call
|
|
--FILE--
|
|
<?php
|
|
class T
|
|
{
|
|
private $var = array();
|
|
|
|
public function add($a)
|
|
{
|
|
array_push($this->var, $a);
|
|
}
|
|
|
|
public function __destruct()
|
|
{
|
|
print_r($this->var);
|
|
}
|
|
}
|
|
|
|
class TT extends T
|
|
{
|
|
}
|
|
$t = new TT();
|
|
$t->add("Hello");
|
|
$t->add("World");
|
|
?>
|
|
--EXPECT--
|
|
Array
|
|
(
|
|
[0] => Hello
|
|
[1] => World
|
|
)
|