|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-10-10 06:47 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 20:00:01 2025 UTC |
See the following script. The depth of the print_r functions output is growing. <?php class A { var $x = 1; var $b = null; function A() { } function setB(&$b) { $this->b = &$b; } } class B { var $x = 2; var $a = null; function B() { } function setA(&$a) { $this->a = &$a; } } $a = new A(); $b = new B(); $a->setB($b); $b->setA($a); print_r($a); $a->x = 3; print_r($a); $b->x = 4; print_r($a); ?>