Re: Re: Allowing is_* functions to accept multiple parameters

From: Date: Wed, 18 Sep 2013 16:09:06 +0000
Subject: Re: Re: Allowing is_* functions to accept multiple parameters
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-69204@lists.php.net to get a copy of this message
On 18 September 2013 14:50, Sean Coates <sean@seancoates.com> wrote: > i.e. is_null($a, $b, $c) would be the same as is_null($a) && is_null($b) > && is_null($c) > > Note that this would not be semantically equivalent in this form, even if > is_null() did accept multiple parameters, because of the > short-circuiting > with &&: See below. On 18 September 2013 15:53, Patrick ALLAERT <patrickallaert@php.net> wrote: > 2013/9/18 Chris London <me@chrislondon.co>: >> I like the naming convention of are_*. For me personally it isn't directly >> intuitive that the multiple parameters of is_* would be compared with an && >> and not an ||. > > isset() already operates that way, keeping "is_" and implementing it > as originally proposed by Leigh would, at least, be consistent. Indeed, my proposal was to mimic short circuiting as isset() does it, evaluating LTR and returning false at the earliest opportunity.

« previous php.internals (#69204) next »