rfc:pcre2-migration

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
rfc:pcre2-migration [2017/10/16 16:42] abrfc:pcre2-migration [2018/03/01 23:09] (current) – pcre2-migration was implemented in PHP 7.3 carusogabriel
Line 3: Line 3:
   * Date: 2017-10-16   * Date: 2017-10-16
   * Author: Anatol Belski, ab@php.net   * Author: Anatol Belski, ab@php.net
-  * Status: Under Discussion+  * Status: Implemented (in PHP 7.3)
   * First Published at: http://wiki.php.net/rfc/pcr2-migration   * First Published at: http://wiki.php.net/rfc/pcr2-migration
  
Line 9: Line 9:
 ===== Introduction ===== ===== Introduction =====
  
-PCRE is the base for many core functionalities in PHP. Currently it is based on 8.x series which a legacy library version today. It is supported by the mainstream, however no new feature implementations flow in there, it is a bugfix version only.+PCRE is the base for many core functionalities in PHP. Currently it is based on 8.x series which is a legacy library version today. It is supported by the mainstream, however no new feature implementations flow in there, it is a bugfix version only.
  
 Still, as ext/pcre is the core functionality for PHP, and it is essential to keep it rolling. The up-to-date version is called PCRE2 and it pertains as currently actively supported, also it is where the new features are implemented. However, the API has certain differencies. As the original [[https://lists.exim.org/lurker/message/20150105.162835.0666407a.en.html|release announcement]] tells, PCRE2 should be taken as a new project. Nevertheless, it is the library with the same purpose, that inherits a lot from the original PCRE. Still, as ext/pcre is the core functionality for PHP, and it is essential to keep it rolling. The up-to-date version is called PCRE2 and it pertains as currently actively supported, also it is where the new features are implemented. However, the API has certain differencies. As the original [[https://lists.exim.org/lurker/message/20150105.162835.0666407a.en.html|release announcement]] tells, PCRE2 should be taken as a new project. Nevertheless, it is the library with the same purpose, that inherits a lot from the original PCRE.
Line 24: Line 24:
   * The 'X' modifier is the default behavior in PCRE2. The current patch reverts the behavior to the meaning of 'X' how it was in PCRE, but it might be better to go with the new behavior and have 'X' turned on by default. So currently no impact, too.   * The 'X' modifier is the default behavior in PCRE2. The current patch reverts the behavior to the meaning of 'X' how it was in PCRE, but it might be better to go with the new behavior and have 'X' turned on by default. So currently no impact, too.
   * Some behavior change due to the newer Unicode engine was sighted. It's Unicode 10 in PCRE2 vs Unicode 7 in PCRE.   * Some behavior change due to the newer Unicode engine was sighted. It's Unicode 10 in PCRE2 vs Unicode 7 in PCRE.
 +  * Some behavior change can be sighted with invalid patterns.
  
  
Line 58: Line 59:
  
 ===== Open Issues ===== ===== Open Issues =====
-Make sure there are no open issues when the vote starts!+None.
  
 ===== Unaffected PHP Functionality ===== ===== Unaffected PHP Functionality =====
-The userland code is unaffected, whereby the pattern checking is done more precise in PCRE2. Invalid patterns are more likely to fail the compilation. The behavior of 'X' modifier was made same, whereby PCRE2 has 'X' on by default. Also, as mentioned in the impacts section, any C code not using PCRE is unaffected. The 'S' modifier can persist, but won't take effect.+The userland code is unaffected, whereby the pattern checking is done more precise in PCRE2. Invalid patterns are more likely to fail the compilation. The behavior of 'X' modifier was made same in the patch, whereby PCRE2 has 'X' on by default. Also, as mentioned in the impacts section, any C code not using PCRE is unaffected. The 'S' modifier can persist, but won't take effect.
  
 The current test suite passes with PCRE2 with almost no change to the tests. One test ext/pcre/tests/bug75207.phpt had to be adjusted because of the newer UNICODE engine. There can be of course behavior differences that teh current tests don't catch, thus it is all the more important to start the QA as early as possible. The current test suite passes with PCRE2 with almost no change to the tests. One test ext/pcre/tests/bug75207.phpt had to be adjusted because of the newer UNICODE engine. There can be of course behavior differences that teh current tests don't catch, thus it is all the more important to start the QA as early as possible.
Line 69: Line 70:
  
   * New pcre2_substitute() API   * New pcre2_substitute() API
-  * Serialization of JIT compiled code+  * Serialization of compiled patterns
   * New compilation options that can be turned into modifiers or used in any way otherwise, such as   * New compilation options that can be turned into modifiers or used in any way otherwise, such as
     * PCRE2_LITERAL      * PCRE2_LITERAL 
Line 85: Line 86:
  
  
-===== Proposed Voting Choices ===== +===== Vote ===== 
-This is admittedly not a language change, though it's an important core functionality, thus require a 2/3 majority to pass by yes/no choice.+Migrate the PHP core to the most current PCRE2 version. 
 + 
 +<doodle title="PCRE2 migration" auth="ab" voteType="single" closed="true"> 
 +   * Yes 
 +   * No 
 +</doodle> 
 + 
 +2/3 majority required. Voting starts on 2017-10-30 and closes no 2017-11-13. 
  
 ===== Patches and Tests ===== ===== Patches and Tests =====
Line 92: Line 101:
  
 ===== Implementation ===== ===== Implementation =====
-After the project is implemented, this section should contain  +Merged into 7.3 http://git.php.net/?p=php-src.git;a=commitdiff;h=a5bc5aed71f7a15f14f33bb31b8e17bf5f327e2d
-  the version(s) it was merged to +
-  - a link to the git commit(s) +
-  - a link to the PHP manual entry for the feature +
-  - link to the language specification section (if any)+
  
 ===== References ===== ===== References =====
Line 106: Line 111:
   * http://www.pcre.org/original/changelog.txt   * http://www.pcre.org/original/changelog.txt
  
-===== Rejected Features ===== 
-Keep this updated with features that were discussed on the mail lists. 
rfc/pcre2-migration.1508172133.txt.gz · Last modified: 2017/10/16 16:42 by ab