PHP 4.0 Bug #7320: variable to reference "magic" cast
| From: | lwest at free dot fr | Date: | Wed, 18 Oct 2000 20:34:06 +0000 |
| Subject: | PHP 4.0 Bug #7320: variable to reference "magic" cast | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-35463@lists.php.net to get a copy of this message | ||
From: lwest@free.fr
Operating system: Linux / Debian 2.2
PHP version: 4.0.3pl1
PHP Bug Type: Scripting Engine problem
Bug description: variable to reference "magic" cast
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::Foo\n";
}
}
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) {
}
}
--
Edit Bug report at: http://bugs.php.net/?id=7320&edit=1