Re: Implicit isset/isempty check on short-ternary operator

From: Date: Sat, 23 Apr 2011 02:54:08 +0000
Subject: Re: Implicit isset/isempty check on short-ternary operator
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20  Groups: php.internals 
Request: Send a blank email to internals+get-51986@lists.php.net to get a copy of this message
What does coalesce() do? If I'm guessing correctly, would proposal #2 that Rune Kaagaard put up solve that for you? https://gist.github.com/909711
Rune's proposal #2, extending func_get_arg(), is impossible to implement/would not work. His proposal #3, which is more like coalesce(), suffers from the drawbacks/problems of coalesce() which I discussed in a recent post (though you can see Rune has some workarounds/hacks to deal with some of the problems). IMHO, his proposal #1 is the only real contender. However, I believe it conflates two problems which others do not want conflated. He briefly dismisses the [?] syntax, because it addresses what he sees as a different problem. However, that different problem is really part of his problem. My contention is that the two parts of his problem are better solved independently (notice-suppression separately to finding an isset/!empty value), and furthermore that one of the two versions of his problem is already partially solved and should be reused, not reinvented (existing ternary operator for a !empty check). Ben.

« previous php.internals (#51986) next »