php-src/Zend/tests/dtor_scope.phpt
2017-01-30 22:50:25 +01:00

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
)