xref: /PHP-7.1/Zend/tests/dtor_scope.phpt (revision 610c7fbe)
1--TEST--
2Scoping in destructor call
3--SKIPIF--
4<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
5--FILE--
6<?php
7        class T
8        {
9                private $var = array();
10
11                public function add($a)
12                {
13                        array_push($this->var, $a);
14                }
15
16                public function __destruct()
17                {
18                        print_r($this->var);
19                }
20        }
21
22        class TT extends T
23        {
24        }
25        $t = new TT();
26        $t->add("Hello");
27        $t->add("World");
28?>
29--EXPECT--
30Array
31(
32    [0] => Hello
33    [1] => World
34)
35