All forms of short tags make your php file not XML compliant.

Notice that the <?php tag which starts every script is a valid XML construct, it is what is called a Processing Instruction (PI) and admits within it absolutely anything except for a ?> which ends the PI. A PI you will be familiar with is the <?xml PI. XML expects something to identify who is to process that PI, thus, there can be no 'anonymous' PI such as a plain <?. Actually, I have heard that it is possible (and have been done) to use more than one interpreter at once on the same document, using the proper processing tags for each language. How you configure that, don't ask me, I wouldn't know.

Any short tag then, whether a <? or a <?=,  is not valid XML.

Whether that is important or not, I can't tell, but it is the only reason I know why short tags might be considered inapropriate and disabled.

Satyam


----- Original Message ----- From: "Mike Borrelli" <[EMAIL PROTECTED]>
To: <php-general@lists.php.net>
Sent: Saturday, September 09, 2006 3:19 PM
Subject: [PHP] Newbie question about <?= ?>


Good day,

While I've been using php for more than a little while now, I've never
understood why the use of the "<?= ...?>" short tag is noted "to be
avoided".

Or rather, I understand that there's an option to disable it, and that's
why it's noted in this way, but I don't understand why it's disabled?
What's gained by writing <?php echo some_function(); ?> over <?=
some_function(); ?>

Thanks in advance.

Cheers,
Mike

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to