PHP 4.0 Bug #7320 Updated: variable to reference "magic" cast
| From: | stas@php.net | Date: | Thu, 19 Oct 2000 10:53:50 +0000 |
| Subject: | PHP 4.0 Bug #7320 Updated: variable to reference "magic" cast | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-35510@lists.php.net to get a copy of this message | ||
ID: 7320
Updated by: stas
Reported By: lwest@free.fr
Status: Closed
Bug Type: Scripting Engine problem
Assigned To:
Comments:
This is intended behaviour.
Previous Comments:
---------------------------------------------------------------------------
[2000-10-18 16:34:06] lwest@free.fr
Container->item becomes a reference after invoking any "Item" method:
$container->item->Foo()
PHP Sapi: apache / Apache 1.3.9 / apxs
Related php.ini directives:
allow_call_time_pass_reference = Off ; as recommended
-----------------SNIPPLET-----------
<?
class Item
{
function Foo()
{
echo "calling Item::Foon";
}
}
class Container
{
var $item;
function Container()
{
$this->item = new Item();
}
function callFoo()
{
$this->item->Foo();
}
}
$c = new Container();
echo "<xmp>nBEFORE:";
var_dump($c);
$c->callFoo();
echo "nAFTER:";
var_dump($c);
echo "</xmp>";
?>
-----------------OUTPUT-----------
BEFORE:
object(container)(1) {
["item"]=>
object(item)(0) {
}
}
calling Item::Foo
AFTER:
object(container)(1) {
["item"]=>
&object(item)(0) {
}
}
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=7320