You are here: Re: Re[2]: [PHP] Is echo tag reasonably portable? « PHP « IT news, forums, messages
Re: Re[2]: [PHP] Is echo tag reasonably portable?

Posted by Robin Vickery on 11/15/05 21:53

Hiyah Richard,

On 11/15/05, Richard Davey <rich@corephp.co.uk> wrote:
> Hi Robin,
>
> Tuesday, November 15, 2005, 6:18:06 PM, you wrote:
>
> > Short tags have been deprecated for years. Both the manual and the
> > php.ini file itself advise people not to use them. Personally I
> > think it's about time they were turned off by default, but that's
> > bound to annoy a lot of people who've ignored the warnings.
>
> 1) They are not deprecated.

Granted, deprecated might be putting it a little strong. They are
certainly not encouraged.

I did quote the note concerning them in its entirety. If I had simply
quoted the manual as saying "be sure not to use short tags" then I
could see your point regarding lack of context. But I didn't.

Similarly, what I quoted was the entire text of the php.ini comment.
Short of including the entire php.ini file, I don't see how much more
context I could possibly give.

> I doubt very much if they will be disabled. They are perfectly valid
> SGML processing instructions.

Firstly, I didn't actually suggest they were disabled. I suggested
that they should be off by default. If they're needed then it's simple
to turn them on, but it would discourage new developers from using a
construct which is not compatible with xml and xhtml.

Now I can't argue that it's not valid sgml as I'm not overly familiar
with the sgml standard (in fact I don't recall mentioning sgml at
all), but it's certainly not valid xml or xhtml.

A '<?' must be followed by a processing instruction target, so if you
have php using short tags embedded in an xml document, then the source
is very unlikely to validate.

Also, if you parse an xml document with php with short tags turned on
- php will try to handle every processing instruction, even
instructions for which it is not the target.

This is likely to become more of an issue, not less as xhtml support
in browsers grows.

> I agree they are a legacy of the PHP3 era, and for re-distributable
> apps you should avoid them. But that is all. Your statements are, in
> their brevity, incorrect.

I would dispute that. In fact, I just have.

-robin

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация