|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-10-19 06:53 UTC] stas@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 10 22:00:02 2026 UTC |
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) { } }