It might be nice to extend it such that if the 1st argument is a list then the
first in the list which is set is returned, eg:

        $var = var_set(($_GET['var'], $_POST['var']), 'default');

If that is the usage, I would suggest coalesce() to be consistent with the same concept in SQL. And you would not need a list as the first argument. Just pass multiple arguments and return the first set value.

$var = var_set($_GET['var'], $_POST['var'], 'default');

http://en.wikipedia.org/wiki/Null_%28SQL%29#COALESCE

Brian.

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to