[phplib] php4 and tree.inc From: Bernd Neumayr (bernd <email protected>)
Date: 08/18/00

i want to use the tree class to generate a menu-structure.

in order to test this class, my first script was the simple one out of the
phplib-documentation. first i tried it on my own machine where windows98,
apache 1.3.12 and php4 are running. it collapsed in an infinite loop. then i
tried it with the webserver of my ISP where php3 is running, there it
worked.

so i looked at the source of tree.inc. there i found at line 76 the
following code
            while ($k || "0"==$k)

                some code .......
            }

this should terminate in the case that there is no child left to traverse.
unfortunately my php4-parser seems to evaluate this while-statement as true
if $k="" or if there isn't any $k left.

i replaced the statement with:
        while ( ($k || "0"==$k) && $t!="NULL")

then it worked.

is there anybody who does know if this is a general problem of php4 or only
on my machine, and if there are other necessary modifications?

thanks
bernd neumayr

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>