Re: Re: Bug #13616 Updated: Compiler complains about function declaration after return is called

From: Date: Wed, 17 Oct 2001 20:42:05 +0000
Subject: Re: 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-68161@lists.php.net to get a copy of this message
----- Original Message ----- From: "Zeev Suraski" <zeev@zend.com> To: "Brian Moon" <brianm@dealnews.com> Cc: <php-dev@lists.php.net> Sent: Wednesday, October 17, 2001 1:18 PM Subject: [PHP-DEV] Re: Bug #13616 Updated: Compiler complains about function declaration after return is called > 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... What do you propose that we PHP coders do then? The include_once() solution is problematic inside of functions because of the way that PHP deals with globals. This isn't so much that you are breaking code... you are removing important functionality from PHP. It isn't a point of moving code towards compatibility with this change, it's the idea of possibly not being able to write modular code any longer because we aren't able to write function libraries. The entire idea of include_once() is backwards to me. You are making the user of the function library responsible for not making coding mistakes such as including a file twice. It should be the included file's responsibility to handle this. You don't even have to do that as a C coder. An included file such as string.h can be included a thousand times in your code without causing problems. You know there is a macro #ifdef statement at the top that keeps it from being included more than once when compiled. PHP developers have no such tools, and now our hack to emulate those tools has been taken away. Daniel

« previous php.dev (#68161) next »