Re: [PHP-DEV] Implicit isset/isempty check on short-ternary operator

2011-04-07 Thread Rasmus Lerdorf
On 04/07/2011 07:02 PM, Stas Malyshev wrote: Hi! $value = isset($a[$key]) ? $a[$key] : 'Not set'; which is exactly the situation I had before it was introduced. Not sure why you would have that expectation. The long ternary doesn't do that, and there is nothing about the short ternary that c

Re: [PHP-DEV] Implicit isset/isempty check on short-ternary operator

2011-04-07 Thread Ben Schmidt
On 8/04/11 4:41 AM, Rasmus Lerdorf wrote: On 4/7/11 2:30 PM, Rafael Dohms wrote: On Thu, Mar 31, 2011 at 7:46 PM, Ben Schmidt wrote: On 1/04/11 3:29 AM, David Coallier wrote: Hey there, I've been working on a little patch that will allow variables ($1) in a short-ternary operation to go thr

Re: [PHP-DEV] Implicit isset/isempty check on short-ternary operator

2011-04-07 Thread Stas Malyshev
Hi! $value = isset($a[$key]) ? $a[$key] : 'Not set'; which is exactly the situation I had before it was introduced. Not sure why you would have that expectation. The long ternary doesn't do that, and there is nothing about the short ternary that changes that. It is true, however I thi

Re: [PHP-DEV] Implicit isset/isempty check on short-ternary operator

2011-04-07 Thread Etienne Kneuss
On Apr 07 18:03:48, Rasmus Lerdorf wrote: > On 4/7/11 5:59 PM, Matthew Weier O'Phinney wrote: > > It may change the semantics as they stand, but I'd argue that the > > _expectation_ from the shorthand ternary is to shorten code that > > currently uses isset(). As it is, I have almost no use for it

Re: [PHP-DEV] Implicit isset/isempty check on short-ternary operator

2011-04-07 Thread Chris Stockton
Hello, On Thu, Apr 7, 2011 at 3:03 PM, Rasmus Lerdorf wrote: > On 4/7/11 5:59 PM, Matthew Weier O'Phinney wrote: >> >> It may change the semantics as they stand, but I'd argue that the >> _expectation_ from the shorthand ternary is to shorten code that >> currently uses isset(). As it is, I have

Re: [PHP-DEV] Implicit isset/isempty check on short-ternary operator

2011-04-07 Thread Rasmus Lerdorf
On 4/7/11 5:59 PM, Matthew Weier O'Phinney wrote: It may change the semantics as they stand, but I'd argue that the _expectation_ from the shorthand ternary is to shorten code that currently uses isset(). As it is, I have almost no use for it at this point, as I end up needing to do: $value

Re: [PHP-DEV] Implicit isset/isempty check on short-ternary operator

2011-04-07 Thread Matthew Weier O'Phinney
On 2011-04-07, Rasmus Lerdorf wrote: > On 4/7/11 2:30 PM, Rafael Dohms wrote: > > On Thu, Mar 31, 2011 at 7:46 PM, Ben Schmidt > > wrote: > > > On 1/04/11 3:29 AM, David Coallier wrote: > > > > I've been working on a little patch that will allow variables ($1) in > > > > a short-ternary operatio

Re: [PHP-DEV] Implicit isset/isempty check on short-ternary operator

2011-04-07 Thread Rasmus Lerdorf
On 4/7/11 2:30 PM, Rafael Dohms wrote: On Thu, Mar 31, 2011 at 7:46 PM, Ben Schmidt wrote: On 1/04/11 3:29 AM, David Coallier wrote: Hey there, I've been working on a little patch that will allow variables ($1) in a short-ternary operation to go through an implicit isset (zend_do_isset_or_i

Re: [PHP-DEV] Implicit isset/isempty check on short-ternary operator

2011-04-07 Thread Rafael Dohms
On Thu, Mar 31, 2011 at 7:46 PM, Ben Schmidt wrote: > On 1/04/11 3:29 AM, David Coallier wrote: >> >> Hey there, >> >> I've been working on a little patch that will allow variables ($1) in >> a short-ternary operation to go through an implicit isset >> (zend_do_isset_or_isempty) check so that the