On Apr 14, 2007, at 6:51 PM, Nicolas A. Bérard-Nault wrote:

Maybe I'm missing something here, but why should PHP be compliant with a standard that absolutely has nothing to do with the language (c.f.: XML) ? Isn't it obvious that a file with the extension .php is NOT an XML file ? It
seems to me the short tags issue is starting to become a bikeshed
argument...

Again, sorry if I'm missing the point.

Say you want PHP to produce XML output in a template like fashion:

<?xml ...>
<user>
  <name><%= $username %></name>
  <zip><%= $zip %></zip>
</user>

Now to me personally this looks very neat and allows for code/ presentation separation, in this case presentation being XML output.

You cannot do this with short tags enabled because PHP will throw a parse error on line one.

So you have two options: enable asp tags and use it as above, or use:

 <name><?php echo $username?></name>

syntax.

It comes down to taste, and to my eye the version with asp tags looks more readable when you use PHP in this way.

Edin

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to