What do you think of the ability to print a variable just by using the = sign and the variable name inside the PHP tags?
Announcement
Collapse
No announcement yet.
<?=$stuff?>
Collapse
X
-
The only downfall as far as I'm aware of using <?= as oposed to
<?php echo is... you'll not get a good validation return toward
XHTML compliance.
If you're using a nice modern version of PHP it does cut down on
the ol' filesize by 7 bytesضkii - formerly pootergeist
teckis - take your time and it'll save you time.
Comment
-
And I just slaved over this computer for a few days and finally came out with my almost finsihed product of 12KB and I must say I used it a lot... Well, you know what they say 12KB is better than 13KB (although I'm sure I didn't use it THAT much, anyway)!Jared Brandt
IKinsler
Comment
-
Originally posted by Mouldy_Goat
Who voted no there?!
Just because I didn't know it existed; "Do you ENJOY of this ability?" that's why
But then, who's the other one who voted no?
Mzzl, ChrisMy Website
010100010011110101110100011011110111000001101000
Comment
-
Originally posted by Mouldy_Goat
Who voted no there?!
The <?=$text?> syntax is great, and is one of the only things ASP has going for it...[+] Computer/PC issues [+] Silverpaw3D
------------------------------------------------
Never buy a dwarf with learning disabilities...
...it's not big, and it's not clever.
Comment
-
Why is this poll closed already - after two days and 7 votes?
Anyway, I vote for "No", because I hardly see any great benefits from this shortcut option. Does it work also when short_open_tags is disabled (for working in XML documents)? I'm a bit skeptic there.
I tend to favor things more in the long run that are still readable after a project is finished two months ago. And with this shorthand syntax, it could be another server-side language.
<?php echo $foo; ?> gets my support, though I try to avoid cluttering the HTML source with lots of simple variable echos.De gustibus non est disputandum.
Comment
-
One of the first things that grabbed me about PHP was not that there seemed to be a way to do everything I wanted but that there were often several ways of doing it, I think this is the case here, most non PHP'ers could guess what <?=$str;?> meant in a second or so.
But I think the whole point here is for non-coders, i.e. designers who want to include pre-written features, I have just written a few forms for a client and all the client has to do is insert
<?=$client_application_form;?>
or whatever - wherever he wants it to appear in his page.
of course
<? echo ("$client_application_form");?>
<? echo $client_application_form;?>
<?print ("$client_application_form");?>
+ printr() & surreal combos of include & readfile & implode(,file())etc etc all work, but for a non-programmer the first causes less confusion, ok its hard to get <? echo $this;?> wrong but they do !
also its less typing so I use it wherever I canresistance is...
MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)
Comment
Comment