|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9090 call_user_method() duplicates object
Submitted: 2001-02-03 17:21 UTC Modified: 2001-10-21 19:11 UTC
From: cazzell at eng dot usf dot edu Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 4.0.4pl1 OS: linux 2.4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
40 - 28 = ?
Subscribe to this entry?

 [2001-02-03 17:21 UTC] cazzell at eng dot usf dot edu
First some sample code:

class foo {
	var $bar = 0;
	function increase () {

$foo = new foo;

print "Bar: " . $foo->bar . "\n";
call_user_method('increase', $foo);
print "Bar: " . $foo->bar . "\n";

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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-17 03:01 UTC] cazzell at eng dot usf dot 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-10-21 19:11 UTC]
The report for which this was duplicate is bogused. See #9054 for more information.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 05:01:28 2024 UTC