rfc:closurefromcallable
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:closurefromcallable [2016/05/15 17:20] – Opened voting. danack | rfc:closurefromcallable [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== PHP RFC: Closure from callable function ====== | ====== PHP RFC: Closure from callable function ====== | ||
- | * Version: | + | * Version: |
* Date: 2016-04-23 | * Date: 2016-04-23 | ||
* Author: Dan Ackroyd, Danack@php.net | * Author: Dan Ackroyd, Danack@php.net | ||
- | * Status: | + | * Status: |
* First Published at: https:// | * First Published at: https:// | ||
Line 125: | Line 125: | ||
==== Performance gain ==== | ==== Performance gain ==== | ||
- | Although PHP has a ' | + | Although PHP has a ' |
Below are two files that call a function 10,000 times which calls itself recursively 8 times. One version has a callable type for the parameter, the other has Closure as the type. Measuring the number of operations with | Below are two files that call a function 10,000 times which calls itself recursively 8 times. One version has a callable type for the parameter, the other has Closure as the type. Measuring the number of operations with | ||
Line 152: | Line 152: | ||
Voting will close at 9pm UTC on the 29th of May 2016. | Voting will close at 9pm UTC on the 29th of May 2016. | ||
- | <doodle title=" | + | <doodle title=" |
* Yes | * Yes | ||
* No | * No | ||
Line 191: | Line 191: | ||
However this RFC takes the position that it is inappropriate to have a separate function per type. Instead having a single function that takes any callable parameter is more powerful, and easier for users to use. | However this RFC takes the position that it is inappropriate to have a separate function per type. Instead having a single function that takes any callable parameter is more powerful, and easier for users to use. | ||
+ | ===== Implementation ===== | ||
+ | |||
+ | Merged into php-src for PHP 7.1: https:// | ||
+ | |||
+ | After the project is implemented, | ||
+ | - a link to the PHP manual entry for the feature | ||
+ | |||
===== Appendix ===== | ===== Appendix ===== | ||
rfc/closurefromcallable.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1