PHP Short Tags

Discussion in 'Programming' started by Absolution, Oct 27, 2011.

to remove all ads.
  1. Absolution

    Absolution New Member

    Messages:
    162
    I use short tags in my code often because they are quite convenient. However it seems that the developers of PHP don't really like them and are considering removing them. Here is a good discussion on the matter:

    http://stackoverflow.com/questions/200640/are-php-short-tags-acceptable-to-use

    For purely philosophical reasons I try to obey strict xhtml when I format webpages. But I am unsure of the major philosophy behind short tag removal. Does anyone here have any opinions on the subject?
     
  2. DHDdirect

    DHDdirect New Member

    Messages:
    383
    I'm pretty sure I have read that ages ago.

    Never really made much since to me anyway, it's not like it's short hand that spans throughout the whole spectrum of code so you are only talking a handful of bits worth of data saved anyway.

    So in other words it's pointless, hence it's eventual removal.
     
  3. Absolution

    Absolution New Member

    Messages:
    162
    True, philosophically it tends to be better to get things done with a simple set of tools in combination, rather than a complex set of tools. Especially if the added tool yields no new information.
     
  4. MarkR

    MarkR New Member

    Messages:
    105
    If you've ever ported a website from a host that allows them to a host that does not then you realise the faff involved when making the website compliant.

    It's safer just to use <?php just to be sure, 3 characters for the sake of compliance!
     
  5. Absolution

    Absolution New Member

    Messages:
    162
    Thanks for your comments! Philosophically they dont seem needed in the programming code. I think in the future I will do without them.
     
  6. n1c0_ds

    n1c0_ds New Member

    Messages:
    54
    It's mostly because of portability issues. I don't use them, but they are really useful for inline PHP since it maintains readability.
     
  7. MarkR

    MarkR New Member

    Messages:
    105
    The worst part is if short tags are disabled on a configuration where they were previously allowed the server will sometimes output the script to the user as plain text. Never an ideal scenario.
     
  8. Absolution

    Absolution New Member

    Messages:
    162
    I noticed that when I installed PHP on an apache server, definitely not a secure situation!
     
  9. computerGeek

    computerGeek Banned

    Messages:
    212
    I really haven't grasped fully what you mean by short tags. :(
     

Share This Page