mirror of
https://github.com/php/php-src.git
synced 2025-08-19 08:49:28 +02:00
submit a test that will fail due to php bug #14744
This commit is contained in:
parent
d454f8bb3a
commit
3a878be7a1
1 changed files with 35 additions and 6 deletions
|
@ -28,6 +28,23 @@ class Test2 extends PEAR {
|
||||||
class Test3 extends Test2 {
|
class Test3 extends Test2 {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// test for bug http://bugs.php.net/bug.php?id=14744
|
||||||
|
class Other extends Pear {
|
||||||
|
|
||||||
|
var $a = 'default value';
|
||||||
|
|
||||||
|
function Other() {
|
||||||
|
$this->PEAR();
|
||||||
|
}
|
||||||
|
|
||||||
|
function _Other() {
|
||||||
|
// $a was modified but here misteriously returns to be
|
||||||
|
// the original value. That makes the destructor useless
|
||||||
|
// The correct value for $a in the destructor shoud be "new value"
|
||||||
|
echo "#bug 14744# Other class destructor: other->a == '" . $this->a ."'\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
print "testing plain destructors\n";
|
print "testing plain destructors\n";
|
||||||
$o = new TestPEAR("test1");
|
$o = new TestPEAR("test1");
|
||||||
$p = new TestPEAR("test2");
|
$p = new TestPEAR("test2");
|
||||||
|
@ -35,6 +52,13 @@ print "..\n";
|
||||||
print "testing inherited destructors\n";
|
print "testing inherited destructors\n";
|
||||||
$q = new Test3;
|
$q = new Test3;
|
||||||
|
|
||||||
|
echo "...\ntesting bug #14744\n";
|
||||||
|
$other = new Other;
|
||||||
|
echo "#bug 14744# Other class constructor: other->a == '" . $other->a ."'\n";
|
||||||
|
// Modify $a
|
||||||
|
$other->a = 'new value';
|
||||||
|
echo "#bug 14744# Other class modified: other->a == '" . $other->a ."'\n";
|
||||||
|
|
||||||
print "..\n";
|
print "..\n";
|
||||||
print "script exiting...\n";
|
print "script exiting...\n";
|
||||||
print "..\n";
|
print "..\n";
|
||||||
|
@ -48,6 +72,10 @@ PEAR constructor called, class=testpear
|
||||||
PEAR constructor called, class=testpear
|
PEAR constructor called, class=testpear
|
||||||
..
|
..
|
||||||
testing inherited destructors
|
testing inherited destructors
|
||||||
|
...
|
||||||
|
testing bug #14744
|
||||||
|
#bug 14744# Other class constructor: other->a == 'default value'
|
||||||
|
#bug 14744# Other class modified: other->a == 'new value'
|
||||||
..
|
..
|
||||||
script exiting...
|
script exiting...
|
||||||
..
|
..
|
||||||
|
@ -56,3 +84,4 @@ PEAR destructor called, class=testpear
|
||||||
This is the TestPEAR(test2) destructor
|
This is the TestPEAR(test2) destructor
|
||||||
PEAR destructor called, class=testpear
|
PEAR destructor called, class=testpear
|
||||||
This is the Test2 destructor
|
This is the Test2 destructor
|
||||||
|
#bug 14744# Other class destructor: other->a == 'new value'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue