Re: [DISCUSSION] Make empty() a Variadic

From: Date: Fri, 13 Feb 2015 11:16:35 +0000
Subject: Re: [DISCUSSION] Make empty() a Variadic
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-82600@lists.php.net to get a copy of this message
Hey, > On 13 Feb 2015, at 07:28, Michael Wallner <mike@php.net> wrote: > > On 12/02/15 19:55, Thomas Punt wrote: > >> I'd like to propose to make empty() a variadic, where if any >> arguments passed in are considered empty, then false is returned > > Should that read "if any arguments passed in are considered *NOT* empty, > then false is returned”? No, I think it’s correct, if confusingly phrased. I believe Thomas is proposing variadic empty() where TRUE is returned if any of its arguments are empty, otherwise FALSE. So, empty($a, $b, $c) would be equivalent to empty($a) || empty($b) || empty($c), much like isset($a, $b, $c) is equivalent to (and implemented as) isset($a) && isset($b) && isset($c). -- Andrea Faulds http://ajf.me/

« previous php.internals (#82600) next »