On 22.11.2009, at 03:13, D. Dante Lorenso wrote:
> Lukas Kahwe Smith wrote:
>> On 21.11.2009, at 22:29, Dante Lorenso wrote:
>>> I would love to restate my recommendation for the function "filled".
>>> Which is the opposite of "empty". Filled would accept a variable
>>> number of arguments and r
Le Sat, 21 Nov 2009 19:52:30 -0800, Rasmus Lerdorf a écrit :
>
> Or better yet, have your filter function return false if the variable
> doesn't exist and use the ternary to set the default. You can do it all
> in a single step then.
>
> $var = filter_func($_GET,'foo')?:42;
>
> Simple and clea
Alban wrote:
> Le Sat, 21 Nov 2009 10:21:18 -0800, Rasmus Lerdorf a écrit :
>> The ternary isn't meant to solve the isset thing you are talking about.
>> It is simply a shortcut to normal ternary operations. The most common
>> case where you don't know if a variable is set is on the initial input
Le Sat, 21 Nov 2009 10:21:18 -0800, Rasmus Lerdorf a écrit :
>
> The ternary isn't meant to solve the isset thing you are talking about.
> It is simply a shortcut to normal ternary operations. The most common
> case where you don't know if a variable is set is on the initial input
> via $_GET or
Lukas Kahwe Smith wrote:
On 21.11.2009, at 22:29, Dante Lorenso wrote:
I would love to restate my recommendation for the function "filled".
Which is the opposite of "empty". Filled would accept a variable
number of arguments and return the first where empty evaluates as
false.
Like empty, fil
On 21.11.2009, at 22:29, Dante Lorenso wrote:
> I would love to restate my recommendation for the function "filled".
> Which is the opposite of "empty". Filled would accept a variable
> number of arguments and return the first where empty evaluates as
> false.
>
> Like empty, filled would not t
I would love to restate my recommendation for the function "filled".
Which is the opposite of "empty". Filled would accept a variable
number of arguments and return the first where empty evaluates as
false.
Like empty, filled would not throw notices for undefined variables.
This is not the same a
More interesting behaviors to dig are there:
variable = ?? ;
variable = ? : ?? ;
or a la javascript
variable = || ;
Best,
On Sat, Nov 21, 2009 at 10:21 AM, Rasmus Lerdorf wrote:
> Alban wrote:
>> Le Sat, 21 Nov 2009 09:48:10 +0100, Lukas Kahwe Smith a écrit :
>>
>>> On 21.11.2009, at 0
Alban wrote:
> Le Sat, 21 Nov 2009 09:48:10 +0100, Lukas Kahwe Smith a écrit :
>
>> 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
Le Sat, 21 Nov 2009 09:48:10 +0100, Lukas Kahwe Smith a écrit :
> 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 cle
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 f
Le Fri, 20 Nov 2009 23:28:39 -0600, Larry Garfield a écrit :
> On Friday 20 November 2009 11:12:29 pm 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 ligh
On Friday 20 November 2009 11:12:29 pm 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.
I cannot comment on the rest of your post right now,
hi all,
Since the new conditionnal operator ternary was introduced in php 5.3,
I'm little confuse about it.
The documentations says :
Since PHP 5.3, it is possible to leave out the middle part of the ternary
operator. Expression expr1 ?: expr3 returns expr1 if expr1 evaluates to
TRUE, and ex
14 matches
Mail list logo