rfc:keywords_as_identifiers

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
Next revisionBoth sides next revision
rfc:keywords_as_identifiers [2013/10/20 10:32] – + perf bwoebirfc:keywords_as_identifiers [2013/10/22 10:31] – + notice on BC bwoebi
Line 3: Line 3:
   * Date: 2013-09-14   * Date: 2013-09-14
   * Author: Bob Weinand, bobwei9@hotmail.com   * Author: Bob Weinand, bobwei9@hotmail.com
-  * Status: Under Discussion+  * Status: Vote
   * First Published at: http://wiki.php.net/rfc/keywords_as_identifiers   * First Published at: http://wiki.php.net/rfc/keywords_as_identifiers
  
Line 9: Line 9:
  
 This RFC aims to remove some restrictions which are due to the fact that keywords are not included in T_STRING (especially for class const, method and class names). This RFC aims to remove some restrictions which are due to the fact that keywords are not included in T_STRING (especially for class const, method and class names).
 +
 +This especially could be useful to preserve more BC compatibility whenever new keywords are introduced. 
  
 ===== What is now possible ===== ===== What is now possible =====
Line 85: Line 87:
 An example what is possible with this patch: An example what is possible with this patch:
 <code php> <code php>
-namespace Test {+namespace Class {
     class List {     class List {
         const default = 0;         const default = 0;
Line 102: Line 104:
    
 namespace { namespace {
-    \Test\List::echo((new Test\List)->new(array(1)));+    \Class\List::echo((new Class\List)->new(array(1)));
 } }
 </code> </code>
Line 123: Line 125:
 ===== Impact on performance ===== ===== Impact on performance =====
  
-There is a slight decrease in performance of up to 10% in worst case. Actually, when used with opcache, any impact shouldn't be noticeable.+There is a slight decrease in //compilation performance// of up to 10% in worst case. So, actually, when used with opcache (execution only), any impact shouldn't be noticeable.
  
 For that benchmark I used an 1.5 megabyte big file wrapped in an //if (false)// (so that nothing is executed): https://raw.github.com/nikic/PHP-Parser/master/lib/PHPParser/Parser.php For that benchmark I used an 1.5 megabyte big file wrapped in an //if (false)// (so that nothing is executed): https://raw.github.com/nikic/PHP-Parser/master/lib/PHPParser/Parser.php
Line 159: Line 161:
   * Initially the patch contained also some support for functions and constants which was removed later due to some resulting syntactic inconsistencies   * Initially the patch contained also some support for functions and constants which was removed later due to some resulting syntactic inconsistencies
  
 +===== Vote =====
 +
 +<doodle title="Should the extended keyword support patch be merged into master?" auth="bwoebi" voteType="single" closed="false">
 +   * Yes
 +   * No
 +</doodle>
 +
 +Deadline is Monday, 28th october 2013.
 ===== Versions ===== ===== Versions =====
   * 1.0: Initial proposal (16.9.2013)   * 1.0: Initial proposal (16.9.2013)
   * 1.1: Added some more examples (18.9.2013)   * 1.1: Added some more examples (18.9.2013)
   * 1.2: Removed some restrictions (now all keywords are permitted except the ones which would conflict with the existing language) (16.10.2013)   * 1.2: Removed some restrictions (now all keywords are permitted except the ones which would conflict with the existing language) (16.10.2013)
rfc/keywords_as_identifiers.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1