Take the State of PHP 2026 Survey →

Deprecate PHP's Short Open Tags View as Markdown

Obsolete
Authors
George Peter Banyard, girgias@php.net
Date
2019-03-20
Version
0.1
Target
PHP 7.4
Implementation
https://github.com/php/php-src/pull/3972
Source
wiki.php.net/rfc/deprecate_php_short_tags

Votes

Deprecate PHP short open tags in PHP 7.4? closed
Yes
38
No
18
56 voters
ashnazg Yes 2019-04-10 14:08
bishop Yes 2019-04-17 05:04
bwoebi Yes 2019-04-10 11:51
carusogabriel No 2019-04-11 08:37
colinodell Yes 2019-04-22 15:08
cpriest Yes 2019-04-16 11:38
danack No 2019-04-10 14:50
daverandom Yes 2019-04-12 09:40
derick Yes 2019-04-11 14:25
diegopires No 2019-04-23 12:09
duncan3dc Yes 2019-04-18 19:08
emir Yes 2019-04-22 07:55
galvao Yes 2019-04-11 02:24
gasolwu Yes 2019-04-18 01:18
girgias Yes 2019-04-10 10:40
guilhermeblanco No 2019-04-23 19:37
heiglandreas Yes 2019-04-11 17:17
jasny Yes 2019-04-21 19:41
jbnahan Yes 2019-04-10 13:04
jhdxr No 2019-04-21 18:42
kalle No 2019-04-10 14:35
kelunik Yes 2019-04-10 19:09
kguest Yes 2019-04-16 14:32
kinncj No 2019-04-22 23:28
klaussilveira No 2019-04-17 13:35
krakjoe No 2019-04-11 09:36
kriscraig Yes 2019-04-11 10:07
laruence No 2019-04-12 06:41
levim Yes 2019-04-10 19:18
malukenho Yes 2019-04-17 12:05
marcio Yes 2019-04-17 13:26
mariano Yes 2019-04-10 11:28
mbeccati Yes 2019-04-12 16:01
mcmic Yes 2019-04-15 10:13
mike Yes 2019-04-16 04:44
narf No 2019-04-10 11:57
nikic No 2019-04-10 22:07
ocramius Yes 2019-04-10 10:45
pauloelr Yes 2019-04-17 12:52
peehaa Yes 2019-04-12 09:22
petk Yes 2019-04-11 11:27
pmjones Yes 2019-04-11 11:49
pmmaga No 2019-04-10 12:48
pollita No 2019-04-22 15:33
rasmus No 2019-04-13 14:56
reywob Yes 2019-04-10 11:01
rtheunissen Yes 2019-04-15 01:20
salathe No 2019-04-10 11:05
santiagolizardo Yes 2019-04-12 21:56
sebastian Yes 2019-04-11 14:44
sergey Yes 2019-04-22 07:49
stas No 2019-04-18 07:09
svpernova09 Yes 2019-04-23 01:57
thekid Yes 2019-04-10 17:37
trowski Yes 2019-04-10 15:02
yunosh No 2019-04-11 11:00
Remove PHP short open tags in PHP 8.0? closed
Yes
42
No
15
57 voters
ashnazg Yes 2019-04-10 14:09
bwoebi Yes 2019-04-10 11:51
carusogabriel Yes 2019-04-11 08:37
colinodell Yes 2019-04-22 15:08
cpriest Yes 2019-04-16 11:38
danack No 2019-04-10 22:42
daverandom Yes 2019-04-12 09:40
derick Yes 2019-04-10 13:09
diegopires Yes 2019-04-16 21:07
duncan3dc Yes 2019-04-18 19:09
emir Yes 2019-04-22 07:55
galvao Yes 2019-04-11 02:24
gasolwu Yes 2019-04-18 01:19
girgias Yes 2019-04-10 10:40
guilhermeblanco Yes 2019-04-23 19:37
heiglandreas Yes 2019-04-11 17:17
jasny Yes 2019-04-21 19:41
jbnahan Yes 2019-04-10 13:05
jhdxr Yes 2019-04-10 11:33
kalle No 2019-04-10 14:35
kelunik Yes 2019-04-10 19:09
kguest Yes 2019-04-16 14:32
kinncj Yes 2019-04-22 23:29
klaussilveira No 2019-04-17 13:36
krakjoe No 2019-04-11 09:36
kriscraig Yes 2019-04-11 10:08
laruence No 2019-04-12 06:42
levim Yes 2019-04-10 19:18
malukenho Yes 2019-04-17 12:05
marcio Yes 2019-04-17 13:25
mariano Yes 2019-04-10 11:28
mbeccati Yes 2019-04-12 16:01
mcmic Yes 2019-04-15 10:13
mike Yes 2019-04-16 04:45
narf No 2019-04-10 11:57
nikic No 2019-04-10 22:07
ocramius Yes 2019-04-10 10:45
pauloelr Yes 2019-04-17 12:52
peehaa Yes 2019-04-11 08:27
petk Yes 2019-04-11 11:27
pmjones Yes 2019-04-11 11:49
pmmaga No 2019-04-10 12:48
pollita No 2019-04-22 15:33
rasmus No 2019-04-13 14:57
reywob No 2019-04-23 06:43
rtheunissen Yes 2019-04-15 01:20
salathe No 2019-04-10 11:06
sammyk Yes 2019-04-21 05:41
santiagolizardo Yes 2019-04-12 21:56
sebastian Yes 2019-04-11 14:44
sergey Yes 2019-04-22 07:49
stas No 2019-04-18 07:09
svpernova09 Yes 2019-04-23 01:57
thekid Yes 2019-04-10 17:37
trowski Yes 2019-04-10 15:02
yunosh No 2019-04-11 11:01
zeev No 2019-04-11 08:55

Discussions on the mailing list

Deprecate short_open_tag ini directive?
by G. P. B. · 26 messages
[RFC] Deprecate PHP's short open tags
by G. P. B. · 11 messages
[RFC] [VOTE] Deprecate PHP's short open tags
by G. P. B. · 94 messages
[RFC] [VOTE] Deprecate PHP's short open tags
by Zeev Suraski · 1 message
[RFC] [DISCUSSION] Deprecate PHP's short open tags V2
by G. P. B. · 33 messages

RFC text

Copied from wiki.php.net, last synchronized Oct 13, 2026 11:54 UTC

Introduction

PHP has provided over the years different ways to indicate the beginning of PHP code other than the standard <?php ... ?> open tags. Most of these opening tags have been removed with PHP 7.0.01), however, PHP's short open tags still remain.

Proposal

Deprecate and disable short_open_tag in PHP 7.4 and remove PHP's short open tags in PHP 8.0.

Reasoning

  • The PHP documentation discourages their usage.
  • PHP's short open tags clash with XML <?xml ?> and can mean two different things depending on the INI configuration.
  • PHP's short open tags depend on an INI directive and as such are non-portable.
  • As such source code may leak if PHP relying on the short open tags is executed on a configuration where this isn't enabled.
  • PHP's parser simplification.

Backward Incompatible Changes

Every script which currently uses the discouraged short <? open tag will need to convert to the standard <?php open tag. This can be automatically achieved by using the “full_opening_tag” fixer from PHP-CS-Fixer.

Proposed PHP Version(s)

Deprecation notice and default value changed to Off in PHP 7.4 and removal in PHP 8.0.

RFC Impact

To SAPIs

None.

To Existing Extensions

Readline and Tokenizer have been updated in the implementations patches.

To Opcache

None to my understanding.

php.ini Defaults

Change short_open_tag from “1” to “0”.

Unaffected PHP Functionality

The <?= short tag is unaffected because as of PHP 5.4 it is always available.

Feedback

Facebook poll 2) created by Peter Kokot: 73 for, 2 against.

Proposed Voting Choices

Yes/No for boths votes.

Vote

Primary vote: Deprecate PHP's short open tags in PHP 7.4. Requires a 2/3 majority.

Secondary vote: Remove PHP's short open tags in PHP 8.0. Requires a 2/3 majority.

Voting started on 2019-04-10 at 10:40 UTC and ran until 2019-04-24 11:20 UTC (for two (2) weeks)

Vote: Deprecate PHP short open tags in PHP 7.4? — Yes: 38 · No: 18 (closed)

Vote: Remove PHP short open tags in PHP 8.0? — Yes: 42 · No: 15 (closed)

Patches and Tests

https://github.com/php/php-src/pull/3972 PHP 7.4 Deprecation Notice Implementation https://github.com/php/php-src/pull/3975 PHP 8.0 Removal Implementation TBD Documentation patch

Implementation

After the project is implemented, this section should contain

  1. the version(s) it was merged into
  2. a link to the git commit(s)
  3. a link to the PHP manual entry for the feature
  4. a link to the language specification section (if any)

References

Initial feedback on Internals (link to External.io) RFC Announcement on Internals (link to External.io) RFC Vote Announcement on Internals (link to External.io)

1)Remove alternative PHP tags RFC https://wiki.php.net/rfc/remove_alternative_php_tags

2)https://fb.com/groups/2204685680/permalink/10157687999015681/