Re: [PHP-DEV] Re: Allowing is_* functions to accept multiple parameters

2013-09-19 Thread Bob Weinand
> Am 19.09.2013 um 11:10 schrieb "Leigh" : > > On 19 September 2013 03:20, William Bartlett > wrote: >> I would argue that LTR support is also inconsistent / not desired. >> >> If I wrote: >> >> $i = 0; >> is_three($i = $i + 1, $i = $i + 1, $i = $i + 1); >> >> I would certainly expect is_three

Re: [PHP-DEV] Re: Allowing is_* functions to accept multiple parameters

2013-09-19 Thread Leigh
On 19 September 2013 03:20, William Bartlett wrote: > I would argue that LTR support is also inconsistent / not desired. > > If I wrote: > > $i = 0; > is_three($i = $i + 1, $i = $i + 1, $i = $i + 1); > > I would certainly expect is_three to return false, but I would also expect > $i to contain thr

Re: [PHP-DEV] Re: Allowing is_* functions to accept multiple parameters

2013-09-18 Thread William Bartlett
I would argue that LTR support is also inconsistent / not desired. If I wrote: $i = 0; is_three($i = $i + 1, $i = $i + 1, $i = $i + 1); I would certainly expect is_three to return false, but I would also expect $i to contain three. php doesn't normally evaluate arguments lazily, it would be wei

Re: [PHP-DEV] Re: Allowing is_* functions to accept multiple parameters

2013-09-18 Thread Bob Weinand
Am 18.09.2013 um 21:57 schrieb "Leigh" : > On 18 September 2013 18:50, Bob Weinand wrote: >> At least, from a technical point, evaluating LTR would require to change the >> engine >> (would be some more complex change as it would require to switch between >> contexts >> and being able to execute

Re: [PHP-DEV] Re: Allowing is_* functions to accept multiple parameters

2013-09-18 Thread Leigh
On 18 September 2013 18:50, Bob Weinand wrote: > At least, from a technical point, evaluating LTR would require to change the > engine > (would be some more complex change as it would require to switch between > contexts > and being able to execute the ZEND_SEND_VAL opcodes one by one Feels lik

Re: [PHP-DEV] Re: Allowing is_* functions to accept multiple parameters

2013-09-18 Thread Bob Weinand
Am 18.9.2013 um 18:09 schrieb Leigh : > On 18 September 2013 14:50, Sean Coates 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 p

Re: [PHP-DEV] Re: Allowing is_* functions to accept multiple parameters

2013-09-18 Thread Leigh
On 18 September 2013 14:50, Sean Coates 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 > w

Re: [PHP-DEV] Re: Allowing is_* functions to accept multiple parameters

2013-09-18 Thread Patrick ALLAERT
2013/9/18 Sean Coates : >> Not a good idea IMHO: it would complexify the execution a lot, think about: > > To be clear, I wasn't proposing an alternative. I was just pointing out that > function call semantics are not the same as conditional (short-circuit) > semantics, as they appeared in the OP

Re: [PHP-DEV] Re: Allowing is_* functions to accept multiple parameters

2013-09-18 Thread Patrick ALLAERT
2013/9/18 Chris London : > 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

Re: [PHP-DEV] Re: Allowing is_* functions to accept multiple parameters

2013-09-18 Thread Sean Coates
> Not a good idea IMHO: it would complexify the execution a lot, think about: To be clear, I wasn't proposing an alternative. I was just pointing out that function call semantics are not the same as conditional (short-circuit) semantics, as they appeared in the OP. S -- PHP Internals - PHP Ru

Re: [PHP-DEV] Re: Allowing is_* functions to accept multiple parameters

2013-09-18 Thread Patrick ALLAERT
2013/9/18 Sean Coates : >> 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 `&&`: > > > fun

Re: [PHP-DEV] Re: Allowing is_* functions to accept multiple parameters

2013-09-18 Thread Chris London
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 ||. On Wed, Sep 18, 2013 at 7:50 AM, Sean Coates wrote: > > i.e. is_null($a, $b, $c) would be the same as is_null($a) && is_null($b)

Re: [PHP-DEV] Re: Allowing is_* functions to accept multiple parameters

2013-09-18 Thread Sean Coates
> 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 `&&`: