rfc:forbid_null_this_in_methods

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:forbid_null_this_in_methods [2016/04/29 16:15] – Clarify nikicrfc:forbid_null_this_in_methods [2016/07/22 20:30] nikic
Line 3: Line 3:
   * Date: 2016-04-29   * Date: 2016-04-29
   * Author: Nikita Popov <nikic@php.net>   * Author: Nikita Popov <nikic@php.net>
-  * Status: Draft+  * Status: Withdrawn
   * Target version: PHP 7.1   * Target version: PHP 7.1
   * Patch: https://github.com/php/php-src/pull/1894   * Patch: https://github.com/php/php-src/pull/1894
Line 40: Line 40:
 </code> </code>
  
-The goal of this RFC is to tighten guarantees that any reasonable person is expecting anyway, removing one of our largest remaining type-system loopholes. This RFC will ensure that within a non-static method the assertion ''$this instanceof self'' never fails. Furthermore this eliminates a large number of runtime checks and paves the way for future optimization (like method inlining).+The goal of this RFC is to tighten guarantees that any reasonable person is expecting anyway, removing one of our largest remaining type-system loopholes. This RFC will ensure that within a non-static method the assertion ''$this instanceof self'' never fails. Furthermore this eliminates a number of hot runtime checks and paves the way for future optimization (like method inlining).
  
 ===== Proposal ===== ===== Proposal =====
Line 170: Line 170:
  
 This pattern will no longer be supported. (Actually it's still possible to do this using variable-variables for people with strong masochistic tendencies.) This pattern will no longer be supported. (Actually it's still possible to do this using variable-variables for people with strong masochistic tendencies.)
- 
-HHVM already forbids ''$this'' from being NULL in non-static methods. This implies that a wide range of major libraries and frameworks are certainly compatible with this behavior. 
  
 ===== Future Scope ===== ===== Future Scope =====
rfc/forbid_null_this_in_methods.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1