Re: nested functions

From: Date: Fri, 02 Feb 2001 15:20:04 +0000
Subject: Re: nested functions
References: 1 2  Groups: php.dev 
Request: Send a blank email to php-dev+get-45616@lists.php.net to get a copy of this message
Andrei Zmievski wrote: > > 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() { > } > } > } sure, this fixes the symptoms, bit if noone can think of a reason or situation where nesting functions would make sense i'd like to have this 'feature' removed it's confusing, unseless IMHO and leaving it possible will block any chance to implement it the way Pascal or gcc in extended mode handle it with the inner function only visible within the scope of the outer one ... -- Hartmut Holzgraefe hartmut@six.de http://www.six.de +49-711-99091-77 Besuchen Sie uns auf der CeBIT 2001 - in Halle 6 Stand F62/4

« previous php.dev (#45616) next »