rfc:closures:removal-of-this
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
rfc:closures:removal-of-this [2009/01/26 12:27] – created cseiler | rfc:closures:removal-of-this [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Removal of $this in closures ====== | ====== Removal of $this in closures ====== | ||
- | |||
- | (NOTE THAT THIS IS NOT COMMITTED YET. THIS PAGE IS STILL WORK IN PROGRESS) | ||
This document describes the changes that were done in order to remove $this support from closures for PHP 5.3 beta1. This has become necessary in order to make sure that when a consensus is found on how to add $this to closures, it will be able to integrate that without BC issues. | This document describes the changes that were done in order to remove $this support from closures for PHP 5.3 beta1. This has become necessary in order to make sure that when a consensus is found on how to add $this to closures, it will be able to integrate that without BC issues. | ||
Line 47: | Line 45: | ||
===== Reflection ===== | ===== Reflection ===== | ||
- | TBD. | + | Reflection was changed a bit in order to make sure Non-OOP-Closures are supported consistently. |
+ | |||
+ | ==== getClosure() / getClosureThis() removal ==== | ||
+ | |||
+ | **Removed** '' | ||
+ | |||
+ | Since allowing that for this special case would perhaps inhibit the possibility of later adding JS-like $this binding to closures at all, it is best to simply remove the method and perhaps later re-add it when the type of implementation is clear. | ||
+ | |||
+ | ==== Modified ReflectionFunction / ReflectionMethod dynamic ==== | ||
+ | |||
+ | In the original RFC, ReflectionMethod also accepted solely $closure as a parameter to the constructor and implied '' | ||
+ | |||
+ | This is now consolidated: | ||
+ | |||
+ | - ReflectionFunction now accepts $closure as sole parameter | ||
+ | - ReflectionMethod now does not automatically infer '' | ||
+ | |||
+ | Thus, a '' | ||
+ | |||
+ | '' | ||
+ | |||
+ | ==== isClosure ==== | ||
+ | |||
+ | isClosure now detects a closure according to the flags (fn_flags & ZEND_ACC_CLOSURE). |
rfc/closures/removal-of-this.1232972855.txt.gz · Last modified: 2017/09/22 13:28 (external edit)