Re: Bug #13616 Updated: Compiler complains about function declaration after return is called
| From: | jeroen@php.net | Date: | Wed, 17 Oct 2001 16:16:59 +0000 |
| Subject: | Re: Bug #13616 Updated: Compiler complains about function declaration after return is called | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-68145@lists.php.net to get a copy of this message | ||
"Brian Moon" <brianm@dealnews.com> wrote in message
news:00c601c15725$d00cf0c0$70fcf818@toney1.al.home.com...
> This is a huge compatibility breaker. The sad part is that you did not
> properly fix the bug in 9884. The bug is that the compiler looks past a
> return when compiling.
That is not the bug, all languages do that. PHP4 has always parsed the whole
script, and will probably remain doing so.
The issue here is that a functiondefinition isn't put in the function table
until the function definition is executed.
This allows conditional function declaration.
Zeev's bugfix fixed bug 9884 by changing semantics of return, by making
'return'-ing from a script simply not possible anymore.
> Does it look past an exit?
It looks past everything, but _return_ in the body of a script is ignored,
but exit isn't. Using exit, nothing changed. Only return changed.
--Jeroen