rfc:pow-operator
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:pow-operator [2013/12/19 19:20] – datibbaw | rfc:pow-operator [2013/12/21 14:16] – datibbaw | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== PHP RFC: Power Operator ====== | ====== PHP RFC: Power Operator ====== | ||
- | * Version: 0.2 | + | * Version: 0.3 |
* Date: 2013-11-23 | * Date: 2013-11-23 | ||
* Author: Tjerk Meesters, datibbaw@php.net | * Author: Tjerk Meesters, datibbaw@php.net | ||
Line 7: | Line 7: | ||
* First Published at: http:// | * First Published at: http:// | ||
* Revision (0.1 → 0.2): 2013-12-19 | * Revision (0.1 → 0.2): 2013-12-19 | ||
+ | * Revision (0.2 → 0.3): 2013-12-21 | ||
===== Introduction ===== | ===== Introduction ===== | ||
- | This proposal is three-fold: | + | This proposal is two-fold: |
- | - Turn the existing [[http:// | + | - Introduce an exponential |
* Avoids a function call. | * Avoids a function call. | ||
* Support for [[rfc: | * Support for [[rfc: | ||
- | - Introduce an exponential (right associative) operator ''< | ||
* Easier to read and shorter to write. | * Easier to read and shorter to write. | ||
* Can be found in other languages. | * Can be found in other languages. | ||
Line 21: | Line 21: | ||
===== Proposal ===== | ===== Proposal ===== | ||
- | |||
- | **pow() as language construct** | ||
- | |||
- | No changes to existing code, safe for one: | ||
- | |||
- | <code php> | ||
- | var_dump(pow([], | ||
- | </ | ||
- | |||
- | Using '' | ||
- | |||
- | <code php> | ||
- | call_user_func(' | ||
- | </ | ||
- | |||
- | **Power operator** | ||
A short working example: | A short working example: | ||
Line 82: | Line 66: | ||
echo ~3 ** 2; // -10 (not 16) | echo ~3 ** 2; // -10 (not 16) | ||
</ | </ | ||
+ | |||
+ | ===== Changelog ===== | ||
+ | |||
+ | 21-Dec-2013: | ||
+ | * Removed turning pow() into a language construct from the proposal, due to BC breaks. | ||
+ | * Closed vote and moved RFC back to Discussion status. | ||
+ | * Reverted commit [[https:// | ||
+ | |||
+ | 22-Dec-2013: | ||
+ | * Moved RFC back to Voting status | ||
===== Discussion ===== | ===== Discussion ===== | ||
Line 170: | Line 164: | ||
External extensions such as [[http:// | External extensions such as [[http:// | ||
- | |||
- | ===== Open Issues ===== | ||
- | |||
- | None. | ||
===== Vote ===== | ===== Vote ===== |
rfc/pow-operator.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1