rfc:saner-inc-dec-operators

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:saner-inc-dec-operators [2023/06/19 14:47] – Wording nits girgiasrfc:saner-inc-dec-operators [2023/07/17 14:52] (current) – Implemented girgias
Line 4: Line 4:
   * Date: 2022-11-21   * Date: 2022-11-21
   * Author: George Peter Banyard, <girgias@php.net>   * Author: George Peter Banyard, <girgias@php.net>
-  * Status: Under Discussion+  * Status: Implemented
   * Target Version: PHP 8.3, PHP 8.(3+x), and PHP 9.0   * Target Version: PHP 8.3, PHP 8.(3+x), and PHP 9.0
-  * Implementation: [[https://github.com/php/php-src/pull/10358]]+  * Implementation: [[https://github.com/php/php-src/commit/d8696f92166eea5e94cc82b64bce72f36fc81d46]]
   * First Published at: [[http://wiki.php.net/rfc/saner-inc-dec-operators]]   * First Published at: [[http://wiki.php.net/rfc/saner-inc-dec-operators]]
  
Line 68: Line 68:
 </PHP> </PHP>
  
-The only examples of an internal class that does not implements a ''do_operation'' handler but implements an ''_IS_NUMBER'' cast in php-src are in Tidy extension (and are of dubious nature):+The only examples of an internal class that does not implement a ''do_operation'' handler but implements an ''_IS_NUMBER'' cast in php-src are in Tidy extension (and are of dubious nature):
 <PHP> <PHP>
 $o = tidy_parse_string("<p>Hello world</p>"); $o = tidy_parse_string("<p>Hello world</p>");
Line 525: Line 525:
  
 Therefore, we consider the value of reducing the semantic complexity of PHP higher than keeping support for this feature in its current form. Therefore, we consider the value of reducing the semantic complexity of PHP higher than keeping support for this feature in its current form.
-The introduction of the <php>str_increment()</php> functions provides a migration paths for users relying on this feature that can easily be polyfilled in prior versions of PHP:+The introduction of the <php>str_increment()</php> function provides a migration path for users relying on this feature that can easily be polyfilled in prior versions of PHP:
 <PHP> <PHP>
 function str_increment_polyfill(string $s): string { function str_increment_polyfill(string $s): string {
Line 550: Line 550:
 </PHP> </PHP>
  
-==== Impact on userland ====+==== Impact of deprecating the PERL string increment feature on userland ====
  
-To determine the impact of this RFC on userland the static analysis tool [[https://www.exakat.io/en/|Exakat]] was used to analyze the X popular open source projects and various private enterprise code bases.+To determine the impact of this RFC on userlandthe static analysis tool [[https://www.exakat.io/en/|Exakat]] was used.  We analyzed 2909 open source projects, including the top 1000 composer packages, plus various private enterprise code bases. ((Raw results of the analysis are available as a [[https://gist.github.com/exakat/9d6d1cc04639a43e62bed85d133d87ef|gist]].))
  
-The only non-false-positive use cases found were all instances of the PERL string increment logic.  Specifically:+The only non-false-positive use cases using the PERL string increment feature are:
  
-  * Generating a list of valid unicode (or ASCII) characters. The most popular project using this is HTMLPurifier (issue got addressed in https://github.com/ezyang/htmlpurifier/pull/367)+  * Generating a list of valid unicode (or ASCII) characters. The most popular project using this is HTMLPurifier, which no longer does so as of [[https://github.com/ezyang/htmlpurifier/pull/367|this PR]]
-  * Generating sequential IDs. The main library doing this is amphp/amp, however a lot of other project depend on this library.+  * Generating sequential IDs. The main library doing this is amphp/amp, however a lot of other projects depend on this library.
   * Incrementing a spreadsheet column.   * Incrementing a spreadsheet column.
  
 In any of these cases, no deprecation notices would be emitted in the first stage of this RFC. In any of these cases, no deprecation notices would be emitted in the first stage of this RFC.
-As the first stage of this RFC also provides the <php>str_increment()</php>, which can be polyfilled, we believe there will be enough time to migrate all these usages to the new function prior to removal of this feature.+As the first stage of this RFC also provides the <php>str_increment()</php> function, which can be polyfilled, we believe there will be enough time to migrate all these usages to the new function prior to removal of this feature.
  
 ===== Backward Incompatible Changes ===== ===== Backward Incompatible Changes =====
Line 585: Line 585:
 As per the voting RFC a yes/no vote with a 2/3 majority is needed for this proposal to be accepted. As per the voting RFC a yes/no vote with a 2/3 majority is needed for this proposal to be accepted.
  
-Voting started on 2023-XX-XX and will end on 2023-XX-XX.+Voting started on 2023-06-28 and will end on 2023-07-12.
 <doodle title="Accept Path to Saner Increment/Decrement operators RFC?" auth="girgias" voteType="single" closed="true"> <doodle title="Accept Path to Saner Increment/Decrement operators RFC?" auth="girgias" voteType="single" closed="true">
    * Yes    * Yes
Line 597: Line 597:
 After the project is implemented, this section should contain After the project is implemented, this section should contain
  
-  * the version(s) it was merged into +  * Version: PHP 8.3 
-  * a link to the git commit(s)+  * Implementation :https://github.com/php/php-src/commit/d8696f92166eea5e94cc82b64bce72f36fc81d46
   * a link to the PHP manual entry for the feature   * a link to the PHP manual entry for the feature
  
 ===== References ===== ===== References =====
  
rfc/saner-inc-dec-operators.1687186069.txt.gz · Last modified: 2023/06/19 14:47 by girgias