note 52455 deleted from language.types.null by danbrown

From: Date: Tue, 19 May 2009 14:20:52 +0000
Subject: note 52455 deleted from language.types.null by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-155740@lists.php.net to get a copy of this message
Note Submitter: disappear at dissolution dot ath dot cx ---- Hi, Im using PHP 5.0.3 i wrote a small null study to test the cases here and this is the results i got Code :: <?php $Array = array ( 0 , '' , FALSE , NULL ) ; $ArrayCount = count ( $Array ) ; $String .= '$Array = ' . "array ( 0 , '' , FALSE , NULL ) <br><br>" ; for ( $i = 0 ; $i < $ArrayCount ; $i++ ) { if ( $Array [ $i ] == NULL ) { $String .= '$Array [ $i ] == NULL :: $Array [ ' . $i . ' ] <br>' ; } if ( $Array [ $i ] === NULL ) { $String .= '$Array [ $i ] === NULL :: $Array [ ' . $i . ' ] <br>' ; } if ( is_null ( $Array [ $i ] ) ) { $String .= 'is_null ( $Array [ $i ] ) :: $Array [ ' . $i . ' ] <br>' ; } } echo $String ; ?> Results :: $Array = array ( 0 , '' , FALSE , NULL ) $Array [ $i ] == NULL :: $Array [ 0 ] $Array [ $i ] == NULL :: $Array [ 1 ] $Array [ $i ] == NULL :: $Array [ 2 ] $Array [ $i ] == NULL :: $Array [ 3 ] $Array [ $i ] === NULL :: $Array [ 3 ] is_null ( $Array [ $i ] ) :: $Array [ 3 ]

« previous php.notes (#155740) next »