Re: [PHP4BETA] Undocumented behavior of PHP 3.0

From: Date: Sat, 15 May 1999 20:54:37 +0000
Subject: Re: [PHP4BETA] Undocumented behavior of PHP 3.0
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-871@lists.php.net to get a copy of this message
Not that my question is relevant anymore (since I already improved Zend to support this:), but just so you'd know what I'm talking about: function declare_foo() { function foo() { ...code... } } if ($foo_needed) { declare_foo(); foo(); } was what I was asking about. I.e., function definitions within other control structures. included files weren't relevant here, because technical reasons I'm too tired to describe right now (and it's not all that interesting anyway). Zeev On Sat, 15 May 1999, Colin Viebrock wrote: > > that way i can make sure that every file only gets included once & every > > "function" file can include all the stuff it depends on which makes life easier for our > > application-developers. > > i think a lot of people use something like this - even though there are some problems with > > nested includes in php3. > > i belive we should support it in the future. > > another thing "nice to have" would be some kind of "include_once" > > function. that would make life far easier when using includes that need includes. > > Maybe I missed something, but Zeev you are asking about function() calls withing function()s, > right? > Does the include matter? > > Oh wait ... I supposed you could include a file within a function, and that included file has > function() > definitions. > > If so, yeah I do that all the time. Or things like > > function foobar() { > if (!$SOME_VARIABLE) { > include("variables.inc"); > } > ... > } > > and variables.inc has a bunch of variable definitions and (maybe) a few function defs. > > - Colin > -- ----------------------------------------------------- Zeev Suraski <zeev@zend.com> For a PGP public key, finger bourbon@netvision.net.il -- PHP 4 Beta

« previous php.version4 (#871) next »