php-src/Zend/tests/bug20240.phpt

42 lines
566 B
Plaintext
Raw Normal View History

2003-06-02 02:35:29 +08:00
--TEST--
2003-07-25 01:07:40 +08:00
Bug #20240 (order of destructor calls)
2003-06-02 02:35:29 +08:00
--FILE--
<?php
class test
{
2003-11-30 21:18:56 +08:00
public $member;
2003-06-02 02:35:29 +08:00
2015-03-31 22:10:22 +08:00
function __construct() {
2003-06-02 02:35:29 +08:00
$this->member = 1;
register_shutdown_function(array($this, 'destructor'));
}
function destructor() {
2003-07-02 07:06:40 +08:00
print __METHOD__ . "\n";
}
function __destruct() {
print __METHOD__ . "\n";
2003-06-02 02:35:29 +08:00
}
function add() {
$this->member += 1;
print $this->member."\n";
}
}
$t = new test();
$t->add();
$t->add();
echo "Done\n";
?>
--EXPECT--
2
3
Done
2004-09-24 04:08:07 +08:00
test::destructor
test::__destruct