0

Just curious to know if

<?php ?>

can increase or improve process speeds and requests as apposed to

<? ?>
  • 6
    No, and using can cause problems if short open tags aren't enabled – Mark Baker Jan 30 '13 at 23:26
  • 3 less letters must be processed a few nanoseconds faster? –  Jan 30 '13 at 23:29
  • @Dagon - not necessarily, because there's special cases of = that need to be "processed" and differentiated from ; and if you're using an opcode cache such as APC, it's a token that isn't necessarily 3 characters less – Mark Baker Jan 30 '13 at 23:33

3 Answers3

1

Theres no performance impact.

to use <? ( or short_tags) you need it enabled on php.ini

short tags are not deprecated.

also <?= which is equal to <?php echo is always available since php 5.4

fig-standarts psr-1 also made clear to use only <?php or <?= for framework codes

This question is a very long and old one about the subject and does have way more information bout it.

Are PHP short tags acceptable to use?

Community
  • 1
  • 1
Danilo Kobold
  • 2,562
  • 1
  • 21
  • 31
0

There is no significant performance implications in using either one.

How ever short tags <? ?> are deprecated and should not be used (except for the short echo tag <?= ?>, which is now available by default).

Petah
  • 45,477
  • 28
  • 157
  • 213
  • 1
    Ack, deleted what I meant to say . . . I still don't think short tags are deprecated. Their usage is frowned upon, but the actual isn't being phased out. – ernie Jan 30 '13 at 23:31
0

No. Both constructs are equally slow (it is noticable when used extensively in templates).

Josef Kufner
  • 2,851
  • 22
  • 28