rfc:variadic_empty

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

rfc:variadic_empty [2015/02/21 00:31]
tpunt
rfc:variadic_empty [2017/09/22 13:28]
Line 1: Line 1:
-====== PHP RFC: Make empty() a Variadic ====== 
-  * Version: 0.1 
-  * Date: 2015-02-20 
-  * Author: Thomas Punt, tpunt@hotmail.co.uk 
-  * Status: Draft 
-  * First Published at: http://​wiki.php.net/​rfc/​variadic_empty 
  
-===== Introduction ===== 
-This RFC aims to make the ''​empty''​ language construct accept any number of arguments. 
- 
-<code php> 
-// example current usage #1: 
-if (empty($a) || empty($b) || empty($c)) {} 
- 
-// example current usage #2: 
-if (!empty($a) && !empty($b) && !empty($c)) {} 
- 
-// new example usage #1: 
-if (empty($a, $b, $c)) {} 
- 
-// new example usage #2: 
-if (!empty($a, $b, $c)) {} 
-</​code>​ 
- 
-===== Proposal ===== 
-By changing ''​empty()''​ to have a variable arity, we can write more compact code when checking for the emptiness of multiple expressions. This seems like a common scenario for web applications... 
- 
-===== Backward Incompatible Changes ===== 
-No BC breakages. 
- 
-===== Proposed PHP Version(s) ===== 
-PHP 7.0 
- 
-===== RFC Impact ===== 
-==== To SAPIs ==== 
-None. 
- 
-==== To Existing Extensions ==== 
-None. 
- 
-==== To Opcache ==== 
-None. 
- 
-==== New Constants ==== 
-None. 
- 
-==== php.ini Defaults ==== 
-None. 
- 
-===== Open Issues ===== 
-None. 
- 
-===== Unaffected PHP Functionality ===== 
-The current functionality of ''​empty()''​ will be completely preserved. 
- 
-===== Future Scope ===== 
-This sections details areas where the feature might be improved in future, but that are not currently proposed in this RFC. 
- 
-===== Proposed Voting Choices ===== 
-Include these so readers know where you are heading and can discuss the proposed voting options. 
- 
-State whether this project requires a 2/3 or 50%+1 majority (see [[voting]]) 
- 
-===== 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,​ this section should contain ​ 
-  - 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 ===== 
-Keep this updated with features that were discussed on the mail lists. 
rfc/variadic_empty.txt · Last modified: 2017/09/22 13:28 (external edit)