rfc:variadic_empty

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
rfc:variadic_empty [2015/03/07 11:57]
tpunt
rfc:variadic_empty [2017/09/22 13:28] (current)
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: ​Voting+  * Status: ​Declined
   * First Published at: http://​wiki.php.net/​rfc/​variadic_empty   * First Published at: http://​wiki.php.net/​rfc/​variadic_empty
  
Line 26: Line 26:
 The proposal is to change ''​empty()''​ so that it can accept multiple arguments. This will enable developers to write more compact code when checking for the emptiness of multiple expressions. The proposal is to change ''​empty()''​ so that it can accept multiple arguments. This will enable developers to write more compact code when checking for the emptiness of multiple expressions.
  
-As the above snippet demonstrates,​ the semantics of a variadic ''​empty()''​ should be the equivalent to logically OR'ing together multiple ''​empty()''​ invocations. Thus, if //any// arguments passed into ''​empty()''​ are considered falsy, then **true** will be returned; if //no// arguments are considered empty, then **false** is returned. This behaviour is the most logical (given ''​empty()'''​s falsy semantics) and seems to be the most prevalent usage of multiple empty checks in userland ​code (therefore being the most beneficial behaviour).+As the above snippet demonstrates,​ the semantics of a variadic ''​empty()''​ should be the equivalent to logically OR'ing together multiple ''​empty()''​ invocations. Thus, if //any// arguments passed into ''​empty()''​ are considered falsy, then **true** will be returned; if //no// arguments are considered empty, then **false** is returned. This behaviour is the most logical (given ''​empty()'''​s falsy semantics) and seems to be the most prevalent usage of multiple empty checks in user-land ​code (therefore being the most beneficial behaviour).
  
 ===== Justification ===== ===== Justification =====
Line 66: Line 66:
 The current functionality of ''​empty()''​ will be completely preserved. The current functionality of ''​empty()''​ will be completely preserved.
  
-===== Proposed Voting Choices ​=====+===== Vote =====
 Because this is a language change, a 2/3 majority is required. It is a simple yes/no vote on whether ''​empty()''​ should be made a variadic. Because this is a language change, a 2/3 majority is required. It is a simple yes/no vote on whether ''​empty()''​ should be made a variadic.
  
-<doodle title="​Make empty() a Variadic"​ auth="​tpunt"​ voteType="​single"​ closed="​false">+<doodle title="​Make empty() a Variadic"​ auth="​tpunt"​ voteType="​single"​ closed="​true">
    * Yes    * Yes
    * No    * No
rfc/variadic_empty.1425729442.txt.gz · Last modified: 2017/09/22 13:28 (external edit)