Rasmus Lerdorf wrote:
Not sure what you guys are talking about. ?: is on the roadmap.
-Rasmus
Ok. That has some signs of hope. What is ?: exactly, though. I
searched '?:' and yeah, good luck with that in documentation. It
doesn't smell like it supports all the specifics that 'filled()' does.
Am I supposed to do this:
$value = $x ?: $y ?: $z ?: $default;
And no warnings will be thrown for $x, $y, and $z not existing? Did you
see my post about 'filled()'?
http://news.php.net/php.internals/23132
Honestly, I'm happy to see '?:' because that's better than nothing, but
I think filled() is more like empty() and would be a better
implementation. If you want to look at the language from a consistency
point of view '?:' is very PERL-like whereas filled(...) is PHP-like:
PERL-like:
$x ~= s/\s+//;
$x = $a ?: $b ?: $c;
PHP-like:
$x = preg_replace("/\s+/", "", $x);
$x = filled($a, $b, $c);
In my PHP zen world, empty() and filled() are friends. Ok, I've been
selling 'filled()' for a while now. Can we reverse the sell and try
this .. why SHOULDN'T filled() be added to the language?
Dante
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php