Bug #9090 Updated: call_user_method() duplicates object

From: Date: Sun, 21 Oct 2001 23:12:00 +0000
Subject: Bug #9090 Updated: call_user_method() duplicates object
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-68652@lists.php.net to get a copy of this message
ID: 9090 Updated by: sniper Reported By: cazzell@eng.usf.edu Old Status: Duplicate Status: Bogus Bug Type: Class/Object related Operating System: linux 2.4 PHP Version: 4.0.4pl1 New Comment: The report for which this was duplicate is bogused. See #9054 for more information. Previous Comments: ------------------------------------------------------------------------ [2001-02-17 03:01:58] cazzell@eng.usf.edu This bug is a duplicate of #9054 and #6347. Andi attached a message to #6347 saying this would be fixed in 4.0.2, but I'm running 4.0.4pl1 and the bug is still there. ------------------------------------------------------------------------ [2001-02-03 17:21:00] cazzell@eng.usf.edu First some sample code: class foo { var $bar = 0; function increase () { $this->bar++; } } $foo = new foo; print "Bar: " . $foo->bar . "\n"; call_user_method('increase', $foo); print "Bar: " . $foo->bar . "\n"; $foo->increase(); print "Bar: " . $foo->bar . "\n"; This will output: Bar: 0 Bar: 0 Bar: 1 It appears that call_user_method is working on a copy of the object rather than the object itself. ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=9090&edit=1

« previous php.dev (#68652) next »