rfc:forbid_null_this_in_methods
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:forbid_null_this_in_methods [2016/04/29 16:09] – nikic | rfc:forbid_null_this_in_methods [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 3: | Line 3: | ||
* Date: 2016-04-29 | * Date: 2016-04-29 | ||
* Author: Nikita Popov < | * Author: Nikita Popov < | ||
- | * Status: | + | * Status: |
* Target version: PHP 7.1 | * Target version: PHP 7.1 | ||
* Patch: https:// | * Patch: https:// | ||
Line 40: | Line 40: | ||
</ | </ | ||
- | 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 '' | + | 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 '' |
===== Proposal ===== | ===== Proposal ===== | ||
Line 92: | Line 92: | ||
This behavior is similar to many other existing restrictions that can be circumvented using variable-variables. For example assignments to '' | This behavior is similar to many other existing restrictions that can be circumvented using variable-variables. For example assignments to '' | ||
- | The following '' | + | The following '' |
<code php> | <code php> | ||
Line 104: | Line 104: | ||
// This call is allowed, because it's not a static call (it only looks like one) | // This call is allowed, because it's not a static call (it only looks like one) | ||
parent:: | parent:: | ||
+ | // This call is also allowed, for the same reason | ||
+ | A:: | ||
} | } | ||
} | } | ||
Line 168: | 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 '' | ||
===== Future Scope ===== | ===== Future Scope ===== |
rfc/forbid_null_this_in_methods.1461946156.txt.gz · Last modified: 2017/09/22 13:28 (external edit)