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

From: Date: Wed, 17 Oct 2001 16:46:33 +0000
Subject: Re: Re: Bug #13616 Updated: Compiler complains about function declaration after return is called
References: 1 2 3 4  Groups: php.dev 
Request: Send a blank email to php-dev+get-68147@lists.php.net to get a copy of this message
I would agree with Brian. It feels like the developers are trying to turn PHP, which is an semi-interpreted language, into a compiled language. At least if you are going to make PHP act like C, you could give us C tools? Where are the conditional #define, #ifdef and #ifndef macros that C coders can freely use? How are we supposed to include user written function libraries in multiple files that are part of a whole? We have no tools to do this and as Brian pointed out include_once() is broke inside of a function definition. You are tying our hands and throwing us into deep water. Either untie our hands, or don't throw us in the water. If you do both, we *will* die. Daniel Beckham phpdoc contributor and serious php coder ----- Original Message ----- From: "Brian Moon" <brianm@dealnews.com> To: <jeroen@php.net>; <php-dev@lists.php.net> Sent: Wednesday, October 17, 2001 11:38 AM Subject: Re: [PHP-DEV] Re: Bug #13616 Updated: Compiler complains about function declaration after return is called > No, exit changed as well. > > function foo(){ echo "foo"; } > exit; > function foo(){ echo "foo"; } > > Yields an error. > > This really has nothing to do with return or exit accept that in the past > there was obviously some mechanism to not complain about duplicate functions > when past an exit or return. Couldn't code after return or exit be treated > as conditional, like code in and if statement? > > And for those who want to use include once, it does not do the job. If I > include_once in a function, the variables that are included in that file are > lost at the end of that function. That does me no good now because the file > can not be included again. > > So, if that is possible, why can't we find a better solution to this. This > sounds like a quick fix for a dumb decision a while back. All that has lead > to is something that is going to break code all over the world. > > <soapbox> > Another point I would like to make is that decisions are being made here by > people who code C in making PHP and do not code PHP for a living. I do. I > know how the focus can be lost as I loose it some times with Phorum. I do > not use Phorum everyday like some others. I realized a while back that the > code I was writing was pretty and neat but a lot of it was useless to the > people who use the product. Please don't get bogged down in what you think > is the way is should work and forget about all the people who have come to > expect certain things of PHP. > </soapbox> > > Brian Moon > ---------------------------------------------------------------------- > dealnews.com, Inc. > Makers of dealnews, dealmac > http://dealnews.com/ | > http://dealmac.com/ > > > ----- Original Message ----- > From: <jeroen@php.net> > To: <php-dev@lists.php.net> > Sent: Wednesday, October 17, 2001 11:16 AM > Subject: [PHP-DEV] Re: Bug #13616 Updated: Compiler complains about function > declaration after return is called > > > > > > "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 > > > > > > > > > > -- > > PHP Development Mailing List <http://www.php.net/> > > To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net > > For additional commands, e-mail: php-dev-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > > > > -- > PHP Development Mailing List <http://www.php.net/> > To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net > For additional commands, e-mail: php-dev-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.dev (#68147) next »