mirror of
https://github.com/php/php-src.git
synced 2024-11-25 02:44:58 +08:00
35 lines
672 B
Plaintext
35 lines
672 B
Plaintext
|
--TEST--
|
||
|
Scoping in destructor call
|
||
|
--SKIPIF--
|
||
|
<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
|
||
|
--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
|
||
|
)
|