|  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: cazzell at eng dot usf dot edu
New email:
PHP Version: OS:


 [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: Sat Apr 13 16:01:31 2024 UTC