Hello PHP Internals! I'd like to propose to make empty() a variadic, where if any arguments passed in are considered empty, then false is returned - otherwise return true. My reasoning for wanting this feature is as follows:1)It's a common scenario to want to check multiple expressions for empty values. I frequently see both of the following pieces of code in projects: #1 if (empty($a) || empty($b) || empty($c)) { // error here } #2 if (!empty($a) && !empty($b) && !empty($c)) { // all good! } Both of the above examples could be shortened if empty() was made to accept multiple arguments: #1 if (empty($a, $b, $c)) { // error here } #2 if (!empty($a, $b, $c)) { // all good! } This creates more compact code that is (in my oppinion, at least) easier to read. Some code from real-world projects that could benefit from this feature:WordPress (one of many): https://github.com/WordPress/WordPress/blob/master/wp-admin/includes/template.php#L1963OpenCart: https://github.com/opencart/opencart/blob/45fc863fa068d82b5280890e6466a198faa54bff/upload/admin/controller/openbay/ebay_profile.php#L128phpbb: https://github.com/phpbb/phpbb/blob/040d451dcca9ae54d8f4b7bdd2f231033765a8f2/phpBB/phpbb/notification/method/jabber.php#L48
2)Users have brought up the want to pass in multiple arguments into empty() before, such as:http://stackoverflow.com/questions/4993104/using-ifempty-with-multiple-variables-phphttp://stackoverflow.com/questions/10950470/check-if-multiple-strings-are-empty There have been solutions brought up by users to emulate a variadic empty, like [1][2], however for unset variables their solutions simply don't work. So all in all, it seems like a simple feature to add for a short-hand notation of checking multiple expressions for emptiness (which seems like a common use-case for users). It has no BC implications and no real downsides (at least I couldn't think of any). I have created a patch [3], and if the feedback is positive, then I'll create an RFC and submit a PR. Thanks,Tom [1] http://stackoverflow.com/a/7798842/4530326[2] http://icoded.it/php-time-saving-function-to-check-multiple-variables-for-empty-values/[3] https://github.com/tpunt/php-src/commit/66c563829775770507147872b98320cdfcb6c51c