RE: [PHP4BETA] Class member variable bug???

From: Date: Fri, 21 Jan 2000 19:31:37 +0000
Subject: RE: [PHP4BETA] Class member variable bug???
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-9347@lists.php.net to get a copy of this message
I know that is the better way. But, I'm not sure if PHP supports that. I just know that it handles classes weird. -----Original Message----- From: dwalt@leopard.arbor.edu [mailto:dwalt@leopard.arbor.edu]On Behalf Of David A. Waltermire Sent: Friday, January 21, 2000 2:28 PM To: PHP LIST Subject: Re: [PHP4BETA] Class member variable bug??? It would be very helpful if you could store a reference to a variable in an array instead of a copy of the variable. Brad Handy wrote: I would try this: $mn_1=new MenuNode("Main1","http://main1.com"); $mn_2=new MenuNode("Sub2","http://sub2.main.com"); $mn_3=new MenuNode("Sub3","http://sub3.main.com"); $mn_4=new MenuNode("Sub4","http://sub4.main.com"); $mn_5=new MenuNode("Sub5","http://sub5.main.com"); $mn_6=new MenuNode("Sub6","http://sub6.main.com"); $mn_7=new MenuNode("Sub7","http://sub7.main.com"); $mn_2->addBranch($mn_4); echo "<hr>"; $mn_2->addBranch($mn_6); echo "<hr>"; $mn_3->addBranch($mn_5); echo "<hr>"; $mn_3->addBranch($mn_7); echo "<hr>"; $mn_1->addBranch($mn_2); echo "<hr>"; $mn_1->addBranch($mn_3); echo "<hr>"; Basically you need to handle the children nodes before you handle the parent nodes. That way you don't get counts misreported. This is only a suggestion. There are many different ways to do it. But the strategy stays the same. --Brad Handy -- PHP 4.0 Beta Mailing List <http://www.php.net/version4/> To unsubscribe, e-mail: php4beta-unsubscribe@lists.php.net For additional commands, e-mail: php4beta-help@lists.php.net To contact the list administrators, e-mail: php4beta-admin@lists.php.net -- David A. Waltermire (mailto:dwalt@supernet.com) Systems Administration Manager Phone: 717-738-7071 Fax: 717-738-7030 D&E SuperNet, A OneMain.com Company http://www.desupernet.net or http://www.onemain.com

« previous php.version4 (#9347) next »