Re: '<?=' with PHP5.3.10
| From: | Kris Craig | Date: | Tue, 06 Mar 2012 04:08:58 +0000 |
| Subject: | Re: '<?=' with PHP5.3.10 | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-58640@lists.php.net to get a copy of this message | ||
Woops ok, you're right about that.
So then, the short open tag is still just <?? (that last question mark is
punctuation ;P)
--Kris
On Mon, Mar 5, 2012 at 7:44 PM, Adam Jon Richardson <adamjonr@gmail.com>wrote:
> On Mon, Mar 5, 2012 at 7:03 PM, Kris Craig <kris.craig@gmail.com> wrote:
>
>> Certainly. I don't believe this is about "inclusion" any more than
>> creating a function called "ech" as an alias for "echo" would be. The
>> <?
>> tag, as you all know, creates problems when working with XML. Furthermore,
>> I've never understood the "it's easier to read" argument since
>> I've found
>> it to be exactly the opposite. The <? as opposed to <?php, at least for
>> me, makes it more difficult to "at a glance" see where the PHP code begins
>> (i.e. it's smaller and more ambiguous). Also, since many hosts disable it
>> by default, getting apps/frameworks that use them working can be an added
>> pain.
>>
>> On the other hand, considering how verbose many of our function names
>> are, I've never understood why the extra 3 characters (or 2 now that it's
>> <?=) is such a burden that we have to deal with all the above annoyances
>> instead. Like I said, other than the fraction of a second it takes to type
>> "php", I really don't see any value in this.
>>
>
> The tag <?= isn't a short version for <?php or <?. The <?= allows you to
> echo output, so these two examples are equivalent:
>
> <?php echo $var; ?>
>
> <?= $var ?>
>
> http://www.php.net/manual/en/ini.core.php#ini.short-open-tag
>
> Before 5.4, turning off short tags turned off the shorthand echo tag, too.
> The value I referenced was regarding the echo form of the tag (<?=), the
> form of the tag Lester was troubleshooting. With 5.4, this will no longer
> be a concern, as the echo form will always be available.
>
> Adam
>