[PHP-DEV] Bug #701: object references are inconsistent From: z-kimmel <email protected>
Date: 08/27/98

From: z-kimmel <email protected>
Operating system: NT
PHP version: 3.0.3
PHP Bug Type: Parser error
Bug description:
Object references appear to change every time a change is made to the object, at least under NT. This means that you can't store mutable objects inside an array, for example. This is bad!

<?php

class example {

var $a;

function test() {
        $temp=$this;
        $this->a=10;
        return $temp;
        }

}

$c = new example;
$c->a=1;
$result=$c->test();
print($result->a);

# prints out the number 1, not the number 10!!

?>

--
PHP Development Mailing List   http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe <email protected>
For help: php-dev-help <email protected>