Sean Coates wrote:

Not meaning to add more confusion, but Coldfusion (yes yes, please keep laughter to a minimum) has had a similar function since the beginning (IIRC).

it's <cfparam ... >
http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/tags-b13.htm

Perhaps a php function "param(...)" ? Even though it's not always a request parameter we'll (developers) be checking, this will be true in most cases.

I don't think a function named param() really fits, but I do like the idea of adding a type check (or in the case of PHP a type cast) to the function.



$level = (int) (isset($_SESSION['level']) ? $_SESSION['level'] : (isset($_REQUEST['level']) ? $_REQUEST['level'] : 1))


becomes

$level = value($_SESSION['level'], $_REQUEST['level'], 1, INT);

Of course, I have no idea how feasible this is.


Marc

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



Reply via email to