Re: suggestion about ternary operator

From: Date: Sat, 21 Nov 2009 08:48:10 +0000
Subject: Re: suggestion about ternary operator
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-46143@lists.php.net to get a copy of this message
On 21.11.2009, at 06:12, Alban wrote: > This is not a big problem but if a solution exists, this would be so > cool ! Especialy when we have to check existance of twenty or more key in > array. Code would be be lighter and clear. > Since i use PHP, I always have in my 'common function file' a function > like that : > > function getIssetVar($var, $default) { return ((isset($var)) ? $var : > $default); } > > So is it possible to make a little improvement on this operator or > introduce a new operator or a core function which do that ? What's your > feeling about it ? this feature request has already been discussed and declined: http://wiki.php.net/rfc/ifsetor please review this rfc before continuing this thread. regards, Lukas Kahwe Smith mls@pooteeweet.org

« previous php.internals (#46143) next »