mirror of
https://github.com/php/php-src.git
synced 2024-10-06 17:26:11 +00:00
40 lines
800 B
Plaintext
40 lines
800 B
Plaintext
|
--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();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
print "test class TestPEAR\n";
|
||
|
$o = new TestPEAR("test1");
|
||
|
$p = new TestPEAR("test2");
|
||
|
var_dump(get_class($o));
|
||
|
var_dump(get_class($p));
|
||
|
|
||
|
?>
|
||
|
--GET--
|
||
|
--POST--
|
||
|
--EXPECT--
|
||
|
test class TestPEAR
|
||
|
PEAR constructor called, class=testpear
|
||
|
PEAR constructor called, class=testpear
|
||
|
string(8) "testpear"
|
||
|
string(8) "testpear"
|
||
|
This is the TestPEAR(test1) destructor
|
||
|
PEAR destructor called, class=testpear
|
||
|
This is the TestPEAR(test2) destructor
|
||
|
PEAR destructor called, class=testpear
|