Removing if: endif; syntax

php.internals

Brian Moon

19 years ago
Reading the array thread, someone mentioned having several ways of doing things. One of their examples was the if: endif; syntax. Forgive me if this has been discussed, but has anyone proposed removing that for PHP6? Seems like the perfect time to do it. Its not recommended. Editors that check PHP syntax warn about it. It just seems like a no brainer. =)
-- Brian Moon ------------- http://dealnews.com/ It's good to be cheap =)

Stefan Walk

19 years ago
Please don't. <?php endif ?> reads much better than <?php } ?> in templates. Regards, Stefan

Robert Cummings

19 years ago
On Mon, 2007-02-05 at 18:36 +0100, Stefan Walk wrote:
> Please don't. <?php endif ?> reads much better than <?php } ?> in templates.
Says you :) But I don't think it should be removed either. Editor's have no business defining what should and should not be useful in a language. Cheers, Rob.
-- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------'

Andi Gutmans

19 years ago
I think removing it at this stage is really not an option. It doesn't hurt anyone and many find it beneficial inside embedded HTML. Andi

Philip Olson

19 years ago
It's also worth mentioning the following historical commit: the 'alternative' syntax is not deprecated Tue Oct 9 23:29:27 2001 UTC (5 years, 3 months ago) by jimw <sect1 id="control-structures.alternative-syntax"> In other words, over five years ago the deprecated status warning was removed from the PHP manual for this alternative syntax. It had been there for ~3.5 months and according to this long thread*, adding that warning was considered a mistake. Regards, Philip * http://marc.theaimsgroup.com/?t=100280720700002 On Feb 5, 2007, at 9:08 PM, Andi Gutmans wrote:

Brian Moon

19 years ago
Philip Olson wrote:
> > It's also worth mentioning the following historical commit: > > the 'alternative' syntax is not deprecated > Tue Oct 9 23:29:27 2001 UTC (5 years, 3 months ago) by jimw > > <sect1 id="control-structures.alternative-syntax"> > > In other words, over five years ago the deprecated status warning was > removed from the PHP manual for this alternative syntax. It had been > there for ~3.5 months and according to this long thread*, adding that > warning was considered a mistake.
Oh, that is good to know. I have evidently not looked at that page in the docs in over 5 years and 3 months. =) So that means the only near official place they are "discouraged" is in the PEAR coding standards. And actually reading it sounds ambiguous. "You are strongly encouraged to always use curly braces even in situations where they are technically optional. Having them increases readability and decreases the likelihood of logic errors being introduced when new lines are added." I think that refers to syntax like: if($var==1) do_something(); So, I guess we can close this discussion. Thanks for entertaining me.
-- Brian Moon ------------- http://dealnews.com/ It's good to be cheap =)