Jason

Rundell

Full Stack Web Developer


PHP short_open_tag: On or Off?

February 13, 2012 4 Comments

I say ON!

There is always debate over whether it’s best to always use <?php to open any PHP script because by default, web servers are set up to not allow for short code. However, I feel it’s better to allow for both <? and <?php to prevent senseless hours of “Why isn’t my code working?” when all it could be is one little <? instead of <?php tag being used.

Coding consistently should always be something we strive for as developers (no matter the language), but be honest, formatting is in the eye of the beholder. Coding your own creation from scratch can become a work of art, but when in a team working on a system, consistency and predictability are key.

There are best practices out there to follow, and if you prefer <? over <?php, just make sure to remain consistent.

  • http://jasonrundell.com/ Jason Rundell

    Here is a comment

    • http://jasonrundell.com/ Jason Rundell

      A second reply

      • http://jasonrundell.com/ Jason Rundell

        A third reply

  • http://jasonrundell.com/ Jason Rundell

    Here is a reply