mirror of
https://github.com/php/php-src.git
synced 2024-10-13 20:42:38 +00:00
81e1ef0ad7
the current class does not have one
59 lines
1.1 KiB
PHP
59 lines
1.1 KiB
PHP
--TEST--
|
|
PEAR constructor/destructor test
|
|
--SKIPIF--
|
|
--FILE--
|
|
<?php
|
|
|
|
require_once "PEAR.php";
|
|
|
|
class TestPEAR extends PEAR {
|
|
function TestPEAR($name) {
|
|
$this->_debug = true;
|
|
$this->name = $name;
|
|
$this->PEAR();
|
|
}
|
|
function _TestPEAR() {
|
|
print "This is the TestPEAR($this->name) destructor\n";
|
|
$this->_PEAR();
|
|
}
|
|
}
|
|
|
|
class Test2 extends PEAR {
|
|
function _Test2() {
|
|
print "This is the Test2 destructor\n";
|
|
$this->_PEAR();
|
|
}
|
|
}
|
|
|
|
class Test3 extends Test2 {
|
|
}
|
|
|
|
print "testing plain destructors\n";
|
|
$o = new TestPEAR("test1");
|
|
$p = new TestPEAR("test2");
|
|
print "..\n";
|
|
print "testing inherited destructors\n";
|
|
$q = new Test3;
|
|
|
|
print "..\n";
|
|
print "script exiting...\n";
|
|
print "..\n";
|
|
|
|
?>
|
|
--GET--
|
|
--POST--
|
|
--EXPECT--
|
|
testing plain destructors
|
|
PEAR constructor called, class=testpear
|
|
PEAR constructor called, class=testpear
|
|
..
|
|
testing inherited destructors
|
|
..
|
|
script exiting...
|
|
..
|
|
This is the TestPEAR(test1) destructor
|
|
PEAR destructor called, class=testpear
|
|
This is the TestPEAR(test2) destructor
|
|
PEAR destructor called, class=testpear
|
|
This is the Test2 destructor
|