As Wez pointed out, this is almost ready to insert into the parser. Most of yesterdays conversation was spent hashing out the ways that this should be implemented.
Remember, one of the biggest reasons for creating this function was so that E_NOTICE would not be issued when attempting to read a variable that may or may not exist.
$x = ifsetor($_GET['foo'], 0);
An expression CANNOT be allowed for the first argument - because you cannot check to see if an expression isset().
~Jason
At 4/16/2004 10:24 PM +0200, Christian Schneider wrote:
Marcus Boerger wrote:You cannot do this because that syntax is already defined for PHP with another semantic.
Ok, missed that one, I never used multiple arguments to isset ;-)
Let's call it ifsetor, ifset or default then. But I still think allowing a list of expressions is a good idea because both
$a = ifsetor($db->get('x'), 'default_x');
and
$a = ifsetor($_REQUEST['x'], $db->get('x'), 'default_x');
make perfect sense IMHO.
- Chris
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php