Shall I enable short tags?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • varois83

    #1

    Shall I enable short tags?

    Hi

    I am fairly new to PHP/mysql and was reading an online tutorial and
    learned that my short tags weren't enabled.
    At this time I have no need for them, my setup apache/mysql/php runs on
    my PC just to test code.
    Shall I enable short tags or not?
    Windows XP pro
    PHP 4

    Thanks a lot

    Patrick

  • Michael Fesser

    #2
    Re: Shall I enable short tags?

    .oO(varois83)
    [color=blue]
    >I am fairly new to PHP/mysql and was reading an online tutorial and
    >learned that my short tags weren't enabled.[/color]

    Good.
    [color=blue]
    >At this time I have no need for them, [...][/color]

    And you don't really need them.
    [color=blue]
    >Shall I enable short tags or not?[/color]

    No.

    Micha

    Comment

    • PhilM

      #3
      Re: Shall I enable short tags?

      >Shall I enable short tags or not?[color=blue]
      >
      > No.
      >
      > Micha[/color]

      In a follow up to Michael, here is a scenario why.

      You just finished writing a web app, wth 100's/1000's of code lines, heaps
      of includes, sub apps etc, making use of short tags. You then upload to your
      newly purchased webspace, and it doesn't work cos they have short tags
      disabled.
      You will have fun then, altering the many instances of short tag code.

      If you don't use short tags, it will still work as expected on a server with
      short tags enabled. Much more friendly.

      I have downloaded a number of cms's that were apparently all the rave, only
      to find they were written using short tags. My test server doesn't have them
      enabled, so to preview them, I had to go through and alter. Not nice. Ended
      up deleting, and looking at others.


      Comment

      • Chung Leong

        #4
        Re: Shall I enable short tags?

        "varois83" <varois83@netze ro.net> wrote in message
        news:1104283461 .548851.133520@ f14g2000cwb.goo glegroups.com.. .[color=blue]
        > Hi
        >
        > I am fairly new to PHP/mysql and was reading an online tutorial and
        > learned that my short tags weren't enabled.
        > At this time I have no need for them, my setup apache/mysql/php runs on
        > my PC just to test code.
        > Shall I enable short tags or not?
        > Windows XP pro
        > PHP 4[/color]

        I like short tags because you can do ASP style <?=$var?> echos. Most ISPs
        leave it on since there's not much of a reason to turn it off.


        Comment

        • R. Rajesh Jeba Anbiah

          #5
          Re: Shall I enable short tags?

          varois83 wrote:[color=blue]
          > I am fairly new to PHP/mysql and was reading an online tutorial and
          > learned that my short tags weren't enabled.
          > At this time I have no need for them, my setup apache/mysql/php runs[/color]
          on[color=blue]
          > my PC just to test code.
          > Shall I enable short tags or not?[/color]

          You're asking one of the "religious" questions--you won't be getting
          fair answer here.

          You can enable short tags. Short tags are cool and fast (in terms of
          coding and execution). When short tags are enabled, you _may_ encounter
          some problems when you're outputting XML codes via PHP; this however
          can be solved by coding in "such a way".

          Most of the servers should support short tags; but there may be few
          that don't support.

          If you use short tags and if the server doesn't support it, you can
          easily do search and replace (ie, <?= to <?php echo). But, there may be
          few or many dumb clients who may not be knowing how to handle this
          situations.

          Personally, though I'm (still) a good fan of short tags, now I'm
          moved to long tags. My suggestion is to enable short tags, but to code
          in long tags--so that you achieve wide range of compatibility. (If you
          disable short tags but did try to output XML, there are chances such
          PHP code may not be usable when running on servers with short tags
          enabled).

          --
          <?php echo 'Just another PHP saint'; ?>
          Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

          Comment

          • varois83

            #6
            Re: Shall I enable short tags?


            Hi

            This is the original poster. I want to thank everybody who took the
            time to answer. I won't enable them at this time.

            Thanks again

            Patrick

            Comment

            • Kenneth Porter

              #7
              Re: Shall I enable short tags?

              "R. Rajesh Jeba Anbiah" <ng4rrjanbiah@r ediffmail.com> wrote in
              news:1104566752 .017055.119260@ z14g2000cwz.goo glegroups.com:
              [color=blue]
              > If you use short tags and if the server doesn't support it, you can
              > easily do search and replace (ie, <?= to <?php echo). But, there may be
              > few or many dumb clients who may not be knowing how to handle this
              > situations.[/color]

              Servers (actually, server-side interpreters), not clients. The clients
              never see the PHP.

              Comment

              • R. Rajesh Jeba Anbiah

                #8
                Re: Shall I enable short tags?

                Kenneth Porter wrote:[color=blue]
                > "R. Rajesh Jeba Anbiah" <ng4rrjanbiah@r ediffmail.com> wrote in
                > news:1104566752 .017055.119260@ z14g2000cwz.goo glegroups.com:
                >[color=green]
                > > If you use short tags and if the server doesn't support it, you can
                > > easily do search and replace (ie, <?= to <?php echo). But, there[/color][/color]
                may be[color=blue][color=green]
                > > few or many dumb clients who may not be knowing how to handle this
                > > situations.[/color]
                >
                > Servers (actually, server-side interpreters), not clients. The[/color]
                clients[color=blue]
                > never see the PHP.[/color]

                I meant, clients==custom ers. My English is very poor; sorry.

                --
                <?php echo 'Just another PHP saint'; ?>
                Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

                Comment

                Working...