If doing the suppression of undefined notices be better if the ? was put after
the
opening square bracket, thereby removing the ambiguity (which I think would be
more troublesome than you think)? $array[?"foo"]
I suppose a non-array-specific version would be to put it after the $.
$?variable
$?array['foo']['bar']
I wonder if you could even use : with this syntax.
$?variable:"default"
$?array['foo']['bar']:"default"
Perhaps using it in function definitions is something to consider, too,
for a callee-specified undefined-notice-silencing mechanism.
function foo($?arg) {
}
Doesn't work for the variable arguments case, though, without resorting
to something IMHO ugly/hard-to-read-and-understand like:
function foo(?) {
}
It's another idea to throw in the mix, though.
I do think the 'silent' modifier that was the original suggestion in
this thread is worth further thought. It may well allow userland
functions to be developed, which might be a benefit.
I personally, though, think a modified ternary operator like the
proposed ??: or the syntax above, is better.
Ben.
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php