PHP 4.0 Bug #6347: Methods called by call_user_method() misbehave
| From: | bachi at insign dot ch | Date: | Fri, 25 Aug 2000 10:06:46 +0000 |
| Subject: | PHP 4.0 Bug #6347: Methods called by call_user_method() misbehave | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-30617@lists.php.net to get a copy of this message | ||
From: bachi@insign.ch
Operating system: Linux
PHP version: 4.0.1pl2
PHP Bug Type: Misbehaving function
Bug description: Methods called by call_user_method() misbehave
If you call a object method with call_user_method(), it can't handle its own object properties
anymore. The demo below returns 1,2,3 for the direct calls as expected, but then just 4,4,4 for the
indirect calls.
class test
{
var $a=0;
function increase()
{
$this->a++;
echo "a is now: ".$this->a."\n<br>";
}
}
$t = new test();
echo "Direct calls:\n<br>";
$t->increase();
$t->increase();
$t->increase();
echo "<p>\n\nIndirect calls:\n<br>";
call_user_method ("increase", $t);
call_user_method ("increase", $t);
call_user_method ("increase", $t);