Re: Bug #13616 Updated: Compiler complains about function declaration after return is called
| From: | Zeev Suraski | Date: | Wed, 17 Oct 2001 18:18:32 +0000 |
| Subject: | Re: Bug #13616 Updated: Compiler complains about function declaration after return is called | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-68158@lists.php.net to get a copy of this message | ||
At 18:07 17-10-01, Brian Moon wrote:
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.No, you're wrong - return is a runtime statement. The fact that the compiler doesn't stop is quite intended. We can make it work with trivial cases such as a return on the top of the file, but obviously, that's not something anybody would use. Real world cases which require run-time evaluation of expressions (e.g., if ($already_included)) are the issue here. So, the fix is quite as it should be, and in our imperfect world, it causes problems :(
Does it look past an exit?Of course, for the reasons above. The entire file is compiled no matter what.
We at dealnews will have to stop at 4.0.6 for the foreseeable future if this stays like this in the 4.1.0 tree. Is there any chance of having this kept as acceptable code?I think we're all aware that this is a problematic issue. I don't have my mind set as to what I support, but I think that breaking PHP-source-level compatibility at 4.1.0 is probably a bad idea (we want to encourage everybody to upgrade to it, so that they start using $_GET and friends). We can revisit this issue in 4.2.0. At any rate, I suggest starting to move towards code that's compatible with this change, in the event that we end up making it... Zeev