On Fri, 02 Feb 2001, Hartmut Holzgraefe wrote:
>  
> it is right now possible to declare functions within functions
> (see bug#9064)
> 
> this will lead to redeclaration errors if you call the outer
> function more then once
> 
> i'm not sure about it, is this a usefull feature (although it
> behaves very different to, say, PASCAL or gcc with nested 
> functions enabled where the inner function is 'local' to the
> namespace of the outer one) or should the engine prevent
> nested function declarations in the first place?

How about a simple check:

function outer()
{
        if (!function_exists('inner')) {
                function inner() {
                }
        }
}

-Andrei
* Entropy isn't what it used to be. *

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to