php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6347 Methods called by call_user_method() misbehave
Submitted: 2000-08-25 06:06 UTC Modified: 2000-08-25 06:09 UTC
From: bachi at insign dot ch Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 4.0.1pl2 OS: Linux
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.
Password:
Status:
Package:
Bug Type:
Summary:
From: bachi at insign dot ch
New email:
PHP Version: OS:

 

 [2000-08-25 06:06 UTC] bachi at insign dot ch
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);

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-25 06:09 UTC] andi@php.net
Please try 4.0.2RC1 available at http://www.php.net/~andi
I should have fixed this and I think the fix made it into RC1. If this still is a problem please open a new bug report.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 15:01:28 2024 UTC