Yeah, I see what you mean...
Some quick test scripts tell me that the problem is only when nesting functions within a class definition. None of the docs i've seen mention a nesting restriction within classes, but it is apparently there.
It appears that the inside function is only defined within PHP if the outside function is evoked. I evoked the outside function in a test script prior to evoking the inside function and it ran fine!
It makes sense from the compiler's perspective. My guess is that this is a side effect of functionality that allows scripts to create new scripts/functions on the fly.
I can see where this can enable us emulate things like function overloading. You can create multiple functions with the same name, but nested inside different function "containers". Depending on what your script needs to do, you can evoke a different container that has the version of the function you want. Later, your script only needs to evoke the "inside" function name, and the correct one will run!
Coooooool...
I will have to experiment to see if the function can be redifined within PHP if I execute the different outside functions at different times...
But I guess we will have to be more careful when includ()ing or require()ing shared function within our class definitions.
-- Rich Rijnders
-- Irvine, CA US