Bug #701: object references are inconsistent
| From: | z-kimmel at uiuc dot edu | Date: | Fri, 28 Aug 1998 01:58:45 +0000 |
| Subject: | Bug #701: object references are inconsistent | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-630@lists.php.net to get a copy of this message | ||
From: z-kimmel@uiuc.edu
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@lists.php.net
For help: php-dev-help@lists.php.net