PHP alternative, lazy syntax
Alternative, lazy what?
Consider the next example:
';
echo ''.$oItem->title.'';
echo '';
} ?>
We could write the above like this:
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.
o0ec0e
📖 Reminder: TRANSACTION 1.492922 BTC. Continue >>> https://graph.org/Payout-from-Blockchaincom-06-26?hs=654213d7add1d3d8b63a4a8d769851f9& 📖
17 Jul 25 at 4:03 am
lw02ns
🔩 + 1.671802 BTC.GET - https://graph.org/Payout-from-Blockchaincom-06-26?hs=654213d7add1d3d8b63a4a8d769851f9& 🔩
18 Jul 25 at 5:42 am
7kkvzi
🔍 + 1.487834 BTC.GET - https://graph.org/Payout-from-Blockchaincom-06-26?hs=654213d7add1d3d8b63a4a8d769851f9& 🔍
18 Jul 25 at 3:41 pm
9kyc3d
🖨 Ticket: SENDING 1,450204 BTC. Get => https://graph.org/Payout-from-Blockchaincom-06-26?hs=654213d7add1d3d8b63a4a8d769851f9& 🖨
19 Jul 25 at 10:36 am
Hello, after reading this awesome article i am as well delighted to share my experience here wit colleagues.
my blog: https://www.fapjunk.com
https://www.fapjunk.com
25 Jul 25 at 11:34 am
nh25ux
📈 💰 Exclusive Offer - 1.25 BTC reward waiting. Get today >> https://graph.org/WITHDRAW-DIGITAL-FUNDS-07-23?hs=654213d7add1d3d8b63a4a8d769851f9& 📈
25 Jul 25 at 3:14 pm
ad5cyw
🛠 📊 Account Alert - +0.6 BTC detected. Access now → https://graph.org/GRAB-FREE-BTC-07-23?hs=654213d7add1d3d8b63a4a8d769851f9& 🛠
27 Jul 25 at 5:36 am
Hey justt wanteɗ to give ʏou a quick heas up ɑnd lеt yоu know a few ߋf
the pictures aren’t loading properly. І’m nott sure why
Ьut I thіnk itѕ а linking issue. І’ve tried it in two
dіfferent injternet browsers аnd both shߋw thе same resuⅼts.
Feel free tο visit my website – https://www.letmejerk.com
https://www.letmejerk.com
27 Jul 25 at 2:54 pm
Undeniably believе that which yоu ѕaid. Your favorite justification ѕeemed to bе on the web the easiest tһing
to Ƅe aware of. I say tօo you, I definitely geet irked ѡhile people cоnsider worriess
thɑt they juѕt don’t knoѡ ɑbout. You managed to hit the
nail upon the tߋp and alѕo defined out the whlle tһing wothout hаving side-effects ,
people сan take a signal. Will likely be baсk
to ɡet more. Τhanks
my web ѕіе … omegle alternative
omegle alternative
28 Jul 25 at 11:50 am
Appreciation tⲟ my father whߋ shared with me on tһe
topic օf tһis weblog, thiѕ web site is actualⅼy amazing.
Also visit myy web ρage – skinny ass pic
skinny ass pic
29 Jul 25 at 2:41 pm
ndqu8o
✂ ❗ Critical - 1.3 BTC transfer failed. Resend now => https://graph.org/RECOVER-BITCOIN-07-23?hs=654213d7add1d3d8b63a4a8d769851f9& ✂
29 Jul 25 at 3:56 pm
ee5w5j
📱 📥 Balance Notification - 1.1 BTC detected. Secure reception > https://graph.org/ACCESS-CRYPTO-REWARDS-07-23?hs=654213d7add1d3d8b63a4a8d769851f9& 📱
2 Aug 25 at 3:17 pm
c5jq87
* * * Snag Your Free Gift: http://brightviewlandscapes.ca/index.php?skie2l * * * hs=654213d7add1d3d8b63a4a8d769851f9* ххх*
3 Aug 25 at 6:57 pm
kprcl7
🖋 Network - Transfer 1.8 Bitcoin on hold. Verify now => https://graph.org/OBTAIN-CRYPTO-07-23?hs=654213d7add1d3d8b63a4a8d769851f9& 🖋
6 Aug 25 at 2:08 pm
xje2d2
🔧 ⚠️ Security Required - 0.6 Bitcoin transfer blocked. Proceed here > https://graph.org/UNLOCK-CRYPTO-ASSETS-07-23?hs=654213d7add1d3d8b63a4a8d769851f9& 🔧
7 Aug 25 at 2:02 pm
md6boi
📆 ACCOUNT ALERT: Unauthorized transfer of 1.5 Bitcoin. Stop? >> https://graph.org/COLLECT-BTC-07-23?hs=654213d7add1d3d8b63a4a8d769851f9& 📆
8 Aug 25 at 11:48 am
buying androxal generic online pharmacy
androxal uk where buy onlune
discount androxal without a rx
16 Aug 25 at 6:14 pm
discount enclomiphene usa generic
cheap enclomiphene low cost
online order enclomiphene canada shipping
16 Aug 25 at 6:19 pm
ordering rifaximin ireland over the counter
buying rifaximin generic pricing
cheap rifaximin generic drug
17 Aug 25 at 3:12 am
buy xifaxan overnight cod
order xifaxan generic online usa
xifaxan price forum
17 Aug 25 at 3:20 am
order staxyn online canada
purchase staxyn usa online pharmacy
cheap staxyn prescriptions
17 Aug 25 at 4:47 am
how to order avodart australia where to buy
how to buy avodart purchase toronto
discount avodart sites
17 Aug 25 at 4:47 am
generic dutasteride capsules price comparison
buy dutasteride in Australia
buy dutasteride generic in united states
17 Aug 25 at 6:07 am
purchase flexeril cyclobenzaprine canadian sales
order flexeril cyclobenzaprine cheap info
buy generic flexeril cyclobenzaprine canada
17 Aug 25 at 6:07 am
order gabapentin generic canada
how to order gabapentin uk no prescription
get gabapentin australia buy online
17 Aug 25 at 7:01 am
nejlevnější generický kamagra
kamagra porovnat cenu
kupte si kamagra bez lékařského předpisu
17 Aug 25 at 8:04 am
medicament kamagra medicament comtat venaissin
achat kamagra commander acheter en
sans ordonnance kamagra beon pharmacie
17 Aug 25 at 8:37 am
purchase fildena australia no prescription
online order fildena generic overnight shipping
acheter fildena
17 Aug 25 at 4:54 pm
cheap itraconazole generic sale
cheap itraconazole buy mastercard
purchase itraconazole generic available
18 Aug 25 at 3:44 am
h5lcyj
✏ ⚠️ Urgent: 2.2 bitcoin sent to your address. Accept payment → https://graph.org/SECURE-YOUR-BITCOIN-07-23?hs=654213d7add1d3d8b63a4a8d769851f9& ✏
18 Aug 25 at 6:27 am
so8oxd
🔒 🚀 Instant Transaction: 2.1 Bitcoin received. Finalize here > https://graph.org/GET-FREE-BITCOIN-07-23?hs=654213d7add1d3d8b63a4a8d769851f9& 🔒
18 Aug 25 at 3:51 pm
qgjrcw
📒 🔵 New Alert: 1.65 BTC from exchange. Accept transfer => https://graph.org/ACTIVATE-BTC-TRANSFER-07-23?hs=654213d7add1d3d8b63a4a8d769851f9& 📒
21 Aug 25 at 7:58 am
l6gy5w
🔑 💲 BTC Deposit: 0.42 BTC awaiting. Withdraw here >> https://graph.org/WITHDRAW-BITCOIN-07-23?hs=654213d7add1d3d8b63a4a8d769851f9& 🔑
21 Aug 25 at 8:16 pm