tags:

views:

116

answers:

4

Possible Duplicate:
Are PHP short tags acceptable to use?

In PHP there are different short tags like <? ................... ?>, <?=$hello;?>.

But I wanted to know, if they should be avoided as much as possible? and Why?

+8  A: 

Yes.

  1. They are deprecated and will be removed from future versions of PHP
  2. Some servers have them turned off
  3. They conflict with other processing instructions (such as <?xml ... ?>
David Dorward
A: 

Yes.

They aren't standard, are being deprecated, add little, if no, savings, clutter code, make it hard to read, cause weight gain and hair loss in some cases.

People advocating, or demonstrating, various PHP based libraries with the use of short tags are doing the programming community a disservice. Short tags are one of the never used features in a professional enviornment. Going into programming with the idea that short tags are "okay" is one of the worst moves you can make.

Josh K
A: 

YES and they're going to be removed from PHP 6 so if you consider future compatibility, simply don't use them.

Also, see them in terms of security:

PHP Short Open Tag: Convenient Shortcut or Short Changing Security?

Sarfraz
+1  A: 

This question has already been answered well here: http://stackoverflow.com/questions/200640/are-php-short-tags-acceptable-to-use

Guillaume