rfc:deprecate_php_short_tags

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
rfc:deprecate_php_short_tags [2019/03/25 12:57] girgiasrfc:deprecate_php_short_tags [2019/08/06 11:18] – Fix status girgias
Line 1: Line 1:
-====== PHP RFC: Deprecate PHP Short tags ======+====== PHP RFC: Deprecate PHP Short open tags ======
   * Version: 0.1   * Version: 0.1
   * Date: 2019-03-20   * Date: 2019-03-20
   * Author: George Peter Banyard, <girgias@php.net>   * Author: George Peter Banyard, <girgias@php.net>
-  * Status: Under Discussion+  * Status: Accepted 
 +  * Target Version: PHP 7.4 
 +  * Implementation: https://github.com/php/php-src/pull/3972
   * First Published at: http://wiki.php.net/rfc/deprecate_php_short_tags   * First Published at: http://wiki.php.net/rfc/deprecate_php_short_tags
  
 ===== Introduction ===== ===== Introduction =====
  
-PHP has provided over the years different ways to indicate the beginning of PHP code other than the standard <php><?php ... ?></php> open tags. Most of these opening tags have been removed with PHP 7.0.0((https://wiki.php.net/rfc/remove_alternative_php_tags|Remove alternative PHP tags RFC)), however, PHP's short open tags still remain.+PHP has provided over the years different ways to indicate the beginning of PHP code other than the standard <php><?php ... ?></php> open tags. Most of these opening tags have been removed with PHP 7.0.0((Remove alternative PHP tags RFC https://wiki.php.net/rfc/remove_alternative_php_tags)), however, PHP's short open tags still remain.
  
 ===== Proposal ===== ===== Proposal =====
-Deprecate and disable <php>short_open_tag</php> in PHP 7.4 and remove PHP short open tags in PHP 8.0.+Deprecate and disable <php>short_open_tag</php> in PHP 7.4 and remove PHP'short open tags in PHP 8.0.
  
 ===== Reasoning ===== ===== Reasoning =====
  
-  * The PHP [[https://secure.php.net/manual/en/language.basic-syntax.phptags.php|documentation]] discourages their usage. +  * The PHP [[https://php.net/manual/en/language.basic-syntax.phptags.php|documentation]] discourages their usage. 
-  * PHP short open tags clash with XML ''<?xml ?>'' and can mean two different things depending on the INI configuration. +  * PHP'short open tags clash with XML ''<?xml ?>'' and can mean two different things depending on the INI configuration. 
-  * PHP short open tags depend on an INI directive and as such are non-portable.+  * PHP'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 ===== ===== Backward Incompatible Changes =====
-Every script which currently uses the discouraged short <php><?</php> open tag will need to convert to the standard <php><?php</php> open tag.+Every script which currently uses the discouraged short <php><?</php> open tag will need to convert to the standard <php><?php</php> open tag.\\ 
 +This can be automatically achieved by using the ''"full_opening_tag"'' fixer from [[https://cs.symfony.com/|PHP-CS-Fixer]].
  
 ===== Proposed PHP Version(s) ===== ===== Proposed PHP Version(s) =====
-Deprecation notice and default value changed to Off in PHP 7.4 and removal in PHP 8.0+Deprecation notice and default value changed to Off in PHP 7.4 and removal in PHP 8.0.
  
 ===== RFC Impact ===== ===== RFC Impact =====
 ==== To SAPIs ==== ==== To SAPIs ====
-None to my understanding.+None.
  
 ==== To Existing Extensions ==== ==== To Existing Extensions ====
-None to my understanding.+Readline and Tokenizer have been updated in the implementations patches.
  
 ==== To Opcache ==== ==== To Opcache ====
Line 36: Line 41:
  
 ==== php.ini Defaults ==== ==== php.ini Defaults ====
-Change <php>short_open_tag</php> from ''"1"'' to ''"0"''+Change <php>short_open_tag</php> from ''"1"'' to ''"0"''.
  
 ===== Unaffected PHP Functionality ===== ===== Unaffected PHP Functionality =====
 The <php><?=</php> short tag is unaffected because as of PHP 5.4 it is always available. The <php><?=</php> short tag is unaffected because as of PHP 5.4 it is always available.
 +
 +===== Feedback =====
 +Facebook poll ((https://fb.com/groups/2204685680/permalink/10157687999015681/)) created by Peter Kokot: 73 for, 2 against.
  
 ===== Proposed Voting Choices ===== ===== Proposed Voting Choices =====
-As with all new RFCs this proposal requires a 2/3 majority+Yes/No for boths votes.
  
 ===== Vote ===== ===== Vote =====
-<doodle title="Deprecate PHP short tags in PHP 7.4?" auth="girgias" voteType="single" closed="true">+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) 
 + 
 +<doodle title="Deprecate PHP short open tags in PHP 7.4?" auth="girgias" voteType="single" closed="true">
    * Yes    * Yes
    * No    * No
 </doodle> </doodle>
  
-<doodle title="Remove PHP short tags in PHP 8.0?" auth="girgias" voteType="single" closed="true">+<doodle title="Remove PHP short open tags in PHP 8.0?" auth="girgias" voteType="single" closed="true">
    * Yes    * Yes
    * No    * No
Line 57: Line 73:
 ===== Patches and Tests ===== ===== Patches and Tests =====
 https://github.com/php/php-src/pull/3972 PHP 7.4 Deprecation Notice Implementation\\ https://github.com/php/php-src/pull/3972 PHP 7.4 Deprecation Notice Implementation\\
-https://github.com/php/php-src/pull/3975 PHP 8 Removal Implementation\\ +https://github.com/php/php-src/pull/3975 PHP 8.0 Removal Implementation\\ 
-TBD Documentation patch+TBD Documentation patch\\
  
 ===== Implementation ===== ===== Implementation =====
Line 68: Line 84:
  
 ===== References ===== ===== References =====
-[[https://externals.io/message/104662|Initial feedback on Internals (link to External.io)]]+[[https://externals.io/message/104662|Initial feedback on Internals (link to External.io)]]\\ 
 +[[https://externals.io/message/104922|RFC Announcement on Internals (link to External.io)]]\\ 
 +[[https://externals.io/message/105201|RFC Vote Announcement on Internals (link to External.io)]]\\
rfc/deprecate_php_short_tags.txt · Last modified: 2019/08/06 17:37 by girgias