Annotation of embedaddon/php/Zend/tests/bug20240.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Bug #20240 (order of destructor calls)
3: --SKIPIF--
4: <?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); ?>
5: --FILE--
6: <?php
7:
8: class test
9: {
10: public $member;
11:
12: function test() {
13: $this->member = 1;
14: register_shutdown_function(array($this, 'destructor'));
15: }
16:
17: function destructor() {
18: print __METHOD__ . "\n";
19: }
20:
21: function __destruct() {
22: print __METHOD__ . "\n";
23: }
24:
25: function add() {
26: $this->member += 1;
27: print $this->member."\n";
28: }
29: }
30:
31: $t = new test();
32:
33: $t->add();
34: $t->add();
35:
36: echo "Done\n";
37: ?>
38: --EXPECT--
39: 2
40: 3
41: Done
42: test::destructor
43: test::__destruct
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>