rfc:instanceof_improvements

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:instanceof_improvements [2021/03/09 09:51] maxsemrfc:instanceof_improvements [2022/04/18 10:51] (current) – Move to withdrawn ilutov
Line 3: Line 3:
   * Date: 2020-05-17   * Date: 2020-05-17
   * Author: Max Semenik, maxsem.wiki@gmail.com   * Author: Max Semenik, maxsem.wiki@gmail.com
-  * Status: Draft+  * Status: Withdrawn
   * First Published at: http://wiki.php.net/rfc/instanceof_improvements   * First Published at: http://wiki.php.net/rfc/instanceof_improvements
  
Line 47: Line 47:
   * An clueless developer trying to achieve with ''123 instanceof $type'' something for which ''$type === "int"'' is a better solution.   * An clueless developer trying to achieve with ''123 instanceof $type'' something for which ''$type === "int"'' is a better solution.
   * A code generator went astray and generates something dubious.   * A code generator went astray and generates something dubious.
-Considering this, I don't think that adding support for constant expressions on LHS would do our end users any good. I propose to continue shortcutting such cases to false and additionally let the developers know they're doing something wrong with ''E_COMPILE_WARNING''.+ 
 +Considering this, I don't think that adding support for constant expressions on LHS would do our end users any good. I propose to continue shortcutting such cases to false (just to make sure they don't rely on this) and additionally let the developers know they're doing something wrong with ''E_COMPILE_WARNING''. Upgrade the warning to error in 9.0.
  
 ===== Backward Incompatible Changes ===== ===== Backward Incompatible Changes =====
-What breaksand what is the justification for it?+This proposal doesn't introduce new syntax, it only affects how some existing code could work by making the operator in some cases return true instead of false or throw warnings. However, since the affected use cases currently don't work (in a sense that they don't produce the result one would expect), existing code to be affected by this should be negligibly hard to come by.
  
 ===== Proposed PHP Version(s) ===== ===== Proposed PHP Version(s) =====
Line 57: Line 58:
 ===== RFC Impact ===== ===== RFC Impact =====
 ==== To SAPIs ==== ==== To SAPIs ====
-Describe the impact to CLI, Development web server, embedded PHP etc.+None.
  
 ==== To Existing Extensions ==== ==== To Existing Extensions ====
-Will existing extensions be affected?+Don't see a reason why they should.
  
 ==== To Opcache ==== ==== To Opcache ====
-It is necessary to develop RFC's with opcache in mind, since opcache is a core extension distributed with PHP. +None.
- +
-Please explain how you have verified your RFC's compatibility with opcache. +
- +
-==== New Constants ==== +
-Describe any new constants so they can be accurately and comprehensively explained in the PHP documentation.+
  
 ===== Open Issues ===== ===== Open Issues =====
Line 74: Line 70:
  
 ===== Unaffected PHP Functionality ===== ===== Unaffected PHP Functionality =====
-List existing areas/features of PHP that will not be changed by the RFC. +Anything not related to ''instanceof''.
- +
-This helps avoid any ambiguity, shows that you have thought deeply about the RFC's impact, and helps reduces mail list noise.+
  
 ===== Future Scope ===== ===== Future Scope =====
-This section details areas where the feature might be improved in future, but that are not currently proposed in this RFC.+I'm currently pondering about extending type casts which would also improve type system and make syntax more consistent, but it'currently brewing in my head and I'm not going to let it out just yet.
  
 ===== Proposed Voting Choices ===== ===== Proposed Voting Choices =====
-What should be done about this (improve instanceof add new operator reject this RFC)?+Accept this RFC (y/n, 2/3 majority required)?
  
 ===== Patches and Tests ===== ===== Patches and Tests =====
-Links to any external patches and tests go here. +* WIP patch: https://github.com/php/php-src/pull/6694
- +
-If there is no patch, make it clear who will create a patch, or whether a volunteer to help with implementation is needed. +
- +
-Make it clear if the patch is intended to be the final patch, or is just a prototype. +
- +
-For changes affecting the core language, you should also provide a patch for the language specification.+
  
 ===== Implementation ===== ===== Implementation =====
rfc/instanceof_improvements.1615283507.txt.gz · Last modified: 2021/03/09 09:51 by maxsem