rfc:closures
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
rfc:closures [2008/09/19 12:02] – Add example of using a lambda inline. rquadling | rfc:closures [2009/03/17 14:27] – Note $this isn't available any more scottmac | ||
---|---|---|---|
Line 3: | Line 3: | ||
* Date: 2008-07-01 | * Date: 2008-07-01 | ||
* Author: Christian Seiler < | * Author: Christian Seiler < | ||
- | * Status: | + | * Status: |
This RFC discusses the introduction of compile-time lambda functions and closures in PHP. | This RFC discusses the introduction of compile-time lambda functions and closures in PHP. | ||
Line 172: | Line 172: | ||
=== Interaction with OOP === | === Interaction with OOP === | ||
+ | |||
+ | $this support has been removed, see [[rfc/ | ||
If a closure is defined inside an object, the closure has full access to the current object through $this (without the need to import it explicitly) and all private and protected methods of that class. This also applies to nested closures. Example: | If a closure is defined inside an object, the closure has full access to the current object through $this (without the need to import it explicitly) and all private and protected methods of that class. This also applies to nested closures. Example: |
rfc/closures.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1