Hello Marc,

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


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

MR> becomes

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

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

MR> Marc

The concept is desirable, but can be achieved if you need it just as
simply using already available syntax (ie a cast):

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

--
Best regards,
 Jason                            mailto:[EMAIL PROTECTED]

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

Reply via email to