|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34372 varibles of A class why not change?
Submitted: 2005-09-05 06:15 UTC Modified: 2005-09-05 08:52 UTC
From: hightman2 at yahoo dot com dot cn Assigned:
Status: Wont fix Package: Class/Object related
PHP Version: 4.4.0 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: hightman2 at yahoo dot com dot cn
New email:
PHP Version: OS:


 [2005-09-05 06:15 UTC] hightman2 at yahoo dot com dot cn
the object's method was called as 'call back' function

Reproduce code:
class hello {
  var $me;
  function hello() {
    $this->me = 1;
    register_shutdown_function(array(&$this, 'show'));
  function show() {
    echo $this->me . "\n";
  function add() {
$h = new hello;
echo "real value: ";
echo "cb value: ";

Expected result:
real value: 2
cb value: 2

Actual result:
real value: 2
cb value: 1


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-05 08:52 UTC]
That's what you get with playing around with references and objects in PHP 4. Fixed in PHP 5.1 and above. Wont fix elsewhere.

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Aug 02 23:01:23 2021 UTC