Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using <?php ?> VS. <? ?> [duplicate]

Tags:

php

Possible Duplicate:
Are PHP short tags acceptable to use?

We are currently using a mix of both styles for writing php code inside our phtml files. Nothing seems to be breaking but I'm just curious about using one over another.

(looking for something more then.. 'its best practice' answer)

like image 631
Adi Avatar asked Nov 01 '25 18:11

Adi


1 Answers

<? ?> are called short tags, they need to be enabled on the server in the php ini file. The only reason why you should not use them is because of compatibility, which in my opinion is not that big a deal, but if you are writing a CMS that is supposed to be used by other people on other servers you should use normal tags <?php ?>

like image 128
Antwan van Houdt Avatar answered Nov 04 '25 09:11

Antwan van Houdt