rfc:variadic_empty
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
rfc:variadic_empty [2015/02/21 00:31] – tpunt | rfc:variadic_empty [2015/03/28 15:54] – tpunt | ||
---|---|---|---|
Line 3: | Line 3: | ||
* Date: 2015-02-20 | * Date: 2015-02-20 | ||
* Author: Thomas Punt, tpunt@hotmail.co.uk | * Author: Thomas Punt, tpunt@hotmail.co.uk | ||
- | * Status: | + | * Status: |
* First Published at: http:// | * First Published at: http:// | ||
===== Introduction ===== | ===== Introduction ===== | ||
- | This RFC aims to make the '' | + | This RFC aims make '' |
<code php> | <code php> | ||
Line 16: | Line 16: | ||
if (!empty($a) && !empty($b) && !empty($c)) {} | if (!empty($a) && !empty($b) && !empty($c)) {} | ||
- | // new example | + | // new proposed |
if (empty($a, $b, $c)) {} | if (empty($a, $b, $c)) {} | ||
- | // new example | + | // new proposed |
if (!empty($a, $b, $c)) {} | if (!empty($a, $b, $c)) {} | ||
</ | </ | ||
===== Proposal ===== | ===== Proposal ===== | ||
- | By changing | + | The proposal is to change |
- | ===== Backward Incompatible Changes ===== | + | As the above snippet demonstrates, |
- | No BC breakages. | + | |
- | ===== Proposed PHP Version(s) | + | ===== Justification |
- | PHP 7.0 | + | |
- | ===== RFC Impact ===== | + | In PHP, it is not uncommon to see conditionals consisting of multiple '' |
- | ==== To SAPIs ==== | + | |
- | None. | + | |
- | ==== To Existing Extensions ==== | + | WordPress (( https:// |
- | None. | + | <code php> |
+ | if ( empty( $pointer_id ) || empty( $selector ) || empty( $args ) || empty( $args[' | ||
+ | </ | ||
+ | OpenCart (( https:// | ||
+ | <code php> | ||
+ | if (empty($setting[' | ||
+ | </ | ||
+ | phpBB (( https:// | ||
+ | <code php> | ||
+ | return !( | ||
+ | empty($this-> | ||
+ | empty($this-> | ||
+ | empty($this-> | ||
+ | empty($this-> | ||
+ | !@extension_loaded(' | ||
+ | ); | ||
+ | </ | ||
- | ==== To Opcache ==== | + | And so on... |
- | None. | + | |
- | ==== New Constants ==== | + | So this seems like quite a common need for users, and one that cannot be emulated in user-land code because of '' |
- | None. | + | |
- | ==== php.ini Defaults ==== | + | This change will also make '' |
- | None. | + | |
- | ===== Open Issues | + | ===== Backward Incompatible Changes |
- | None. | + | No BC breakages. |
+ | |||
+ | ===== Proposed PHP Version(s) ===== | ||
+ | PHP 7.0 | ||
===== Unaffected PHP Functionality ===== | ===== Unaffected PHP Functionality ===== | ||
The current functionality of '' | The current functionality of '' | ||
- | ===== Future Scope ===== | + | ===== Vote ===== |
- | This sections details areas where the feature might be improved in future, but that are not currently proposed in this RFC. | + | Because |
- | ===== Proposed Voting Choices ===== | + | <doodle title="Make empty() a Variadic" |
- | Include these so readers know where you are heading and can discuss the proposed voting options. | + | * Yes |
+ | * No | ||
+ | </ | ||
- | State whether this project requires a 2/3 or 50%+1 majority (see [[voting]]) | + | Voting starts on 2015-03-07 and ends on 2015-03-21. |
===== Patches and Tests ===== | ===== Patches and Tests ===== | ||
- | Links to any external patches and tests go here. | ||
- | |||
- | If there is no patch, make it clear who will create a patch, or whether a volunteer to help with implementation is needed. | ||
- | |||
- | Make it clear if the patch is intended to be the final patch, or is just a prototype. | ||
- | |||
- | ===== Implementation ===== | ||
- | After the project is implemented, | ||
- | - the version(s) it was merged to | ||
- | - a link to the git commit(s) | ||
- | - a link to the PHP manual entry for the feature | ||
- | |||
- | ===== References ===== | ||
- | Links to external references, discussions or RFCs | ||
- | ===== Rejected Features ===== | + | PR: https:// |
- | Keep this updated with features that were discussed on the mail lists. | + |
rfc/variadic_empty.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1