>I am building a recursive Menu object.  Inside each menu item there is an
>array which should allow me to add submenu items and so on.  I am having
>trouble, though, with getting the submenus to stay.  They are
>disappearing as I go along.

Without really going through your code (sorry) I would hazard a guess that
you are assigning by value, rather than by reference - by default, the '='
operator in PHP passes a copy of an object or variable, rather than a
reference to it. The 'new' language construct does this as well. So do
functions, when they return values. All of this is very annoying and
requires you to liberally sprinkle your code with the '&' that denotes
passing-by-reference.

---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca            http://mike.teczno.com/contact.html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to