PHP alternative, lazy syntax

Alternative, lazy what?

Consider the next example:

';
     echo ''.$oItem->title.'';
     echo '';
} ?>

We could write the above like this:


     
  • title?>
  • Personally I think the second example is much easier to understand and a lot clearer for someone who isn’t familiar with PHP then the second one. (unfortunately my code highlight plugin thinks different though 😉 ) No braces in the code will also prevent some people to get the idea it’s to difficult to use PHP inside HTML and that integrating PHP into HTML is a task for PHP developers only. Also notice the advantage when indenting the HTML code.
    Futher it helps me to distinguish in my own projects template files and controllers, models,… because of the different syntax. So when I have a a file with mixed PHP and HTML this is the preferred way for me.

    Great! Let’s start using it!
    Good idea but bear in mind that their are a few drawbacks:

    • Not all servers allow the shorttags (check the short_open_tag entry in your php.ini file)
    • Not using ; in the above example is a bad practice and should be avoided
    • The most important one, their are other template engines on the market like Smarty, Dwoo, Savant, Template Blocks and a lot more that do the same thing but then easier or better (although you have minimal overhead)

    Futher I should note their are some heavy discussions (still?) going on in the PHP community whether the short tags are genius or just plain evil. One thing is pretty sure now the short tags will still be available in PHP version 6.

    For the complete list of the alternative syntax visit php.net

    Please fill in the poll and leave a comment.

    Comments

    1,499 responses to “PHP alternative, lazy syntax”

    1. needlelynx13.bravejournal.net Avatar

      References:

      Spil casino med de bedste udbetalingsforhold

      References:
      https://doc.adminforge.de/s/96uWElJfKR

    2. worldclassdjs.com Avatar

      References:

      Spillemaskiner med bedste udbetalingsprocent

      References:
      https://fanajobs.com/profile/vntkristan2596

    3. https://md.un-hack-bar.de Avatar

      References:

      Optimer din casino udbetaling

      References:
      http://okprint.kz/user/teabail30/

    4. 500px.com Avatar

      References:

      Udbetaling af store gevinster casino

      References:
      https://moiafazenda.ru/user/vacuumdash85/

    5. git.hanumanit.co.th Avatar

      References:

      Casinoer med høj udbetalingskvote

      References:
      https://www.quranpak.site/robculbert4159

    6. sibze.ru Avatar

      References:

      Casinoer med gennemsigtig udbetaling

      References:
      https://www.ricetteclara.com/membri/bonetext56/activity/112530/

    7. git.chalypeng.xyz Avatar

      References:

      Casinoer med højeste udbetalingsgaranti

      References:
      https://git.hubhoo.com/louveniacard3

    8. 881.cz Avatar

      References:

      Hvad betyder høj udbetaling på casino

      References:
      https://v.gd/ySbM2p

    9. https://syq.im Avatar

      References:

      Erfarne spilleres valg af casino udbetaling

      References:
      https://phoebe.roshka.com/gitlab/helencaron593

    10. git.bp-web.app Avatar

      References:

      Gennemsigtige casino udbetalingsrater

      References:
      https://git.vhdltool.com/briannegerken2

    11. http://madk-auto.ru Avatar

      References:

      Casinoer med højeste udbetalingsrate Danmark

      References:
      https://telegra.ph/Online-Casinos-mit-hoher-Auszahlungsquote-2026-Top-RTPs-04-30

    12. gitea.goldendeliverer.com Avatar

      References:

      RTP på danske casino sider

      References:
      https://git.dslak.it/noeliaepp39246

    13. karayaz.ru Avatar

      References:

      Bedst betalende online casinoer

      References:
      https://www.24propertyinspain.com/user/profile/1434307

    14. suprasage.com Avatar

      References:

      Bedste danske casinoer for høje gevinster

      References:
      https://git.htns.com/karine82e34401

    15. topsitenet.com Avatar

      References:

      Casinoer med dansk licens og høj udbetaling

      References:
      https://pads.jeito.nl/s/dcsdcN5ZUy

    16. https://www.forum.uookle.com Avatar

      References:

      Bedste casinoer med høj udbetaling

      References:
      https://medibang.com/author/28219115/

    17. xhdyz.cn Avatar

      References:

      Casino med mest udbetaling til spilleren

      References:
      https://www.instapaper.com/p/17653759

    18. www.ozodagon.com Avatar

      References:

      Hvilket casino udbetaler mest

      References:
      http://qa.doujiju.com/index.php?qa=user&qa_1=shadeforest54

    19. jobs.foodtechconnect.com Avatar

      References:

      Overblik over casino udbetalinger

      References:
      https://koseongnam.com/alannahhertz19

    20. pads.zapf.in Avatar

      References:

      Hvilke spillemaskiner giver den højeste udbetaling

      References:
      https://lichnyj-kabinet-vhod.ru/user/fingerporter64/

    21. support.roombird.ru Avatar

      References:

      Bedste udbyttende casinoer Danmark

      References:
      https://atomcraft.ru/user/violatree83/

    22. 打开Binance账户 Avatar

      Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me? https://www.binance.com/register?ref=IXBIAFVY

    23. moʻstbet Avatar

      I know this website offers quality depending
      content and other stuff, is there any other site which
      offers such information in quality?

    Leave a Reply

    Your email address will not be published. Required fields are marked *