NYCPHP Meetup

NYPHP.org

[nycphp-talk] TRUE/FALSE and $_SESSION variables

Chris Shiflett shiflett at php.net
Wed Jul 11 23:05:17 EDT 2007


Michael Southwell wrote:
> This tiny script:
> <?php
> session_start();
> $ineligibleFlag = FALSE;
> if ( $ineligibleFlag === FALSE ) echo 'it is false<br />';
> $_SESSION['ineligibleFlag'] = FALSE;
> print_r( $_SESSION );
> 
> produces this output:
> it is false
> Array ( [ineligibleFlag] => )

When cast to a string, FALSE is the empty string.

Chris

-- 
Chris Shiflett
http://shiflett.org/



More information about the talk mailing list