note 52455 added to language.types.null

From: Date: Mon, 02 May 2005 10:20:15 +0000
Subject: note 52455 added to language.types.null
Groups: php.notes 
Request: Send a blank email to php-notes+get-88857@lists.php.net to get a copy of this message
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 ] ---- Manual Page -- http://www.php.net/manual/en/language.types.null.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+52455 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52455&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52455&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52455&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52455&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52455&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+52455&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#88857) next »