On Sun, 11 Jul 2004, Jason Garber wrote:
> 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);

The problem with that is this:

  $level = (int) value($_SESSION['level');

Assume there is no level entry in the session array.  This then
effectively becomes:

  $level = (int) NULL;

Guess what that gives you?  Obviously not what we want here which is why
we are talking about a mechanism to not cast that default value whether it
be the unspecified NULL default, or whatever default is passed in.

-Rasmus

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

Reply via email to