note 55815 added to language.expressions

From: Date: Sun, 14 Aug 2005 14:00:53 +0000
Subject: note 55815 added to language.expressions
Groups: php.notes 
Request: Send a blank email to php-notes+get-93636@lists.php.net to get a copy of this message
this code: print array() == NULL ? "True" : "False"; print " (" . (array() == NULL) . ")\n"; $arr = array(); print array() == $arr ? "True" : "False"; print " (" . (array() == $arr) . ")\n"; print count(array()) . "\n"; print count(NULL) . "\n"; will output (on php4 and php5): True (1) True (1) 0 0 so to decide wether i have NULL or an empty array i will also have to use gettype(). this seems some kind of weird for me, although if is this is a bug, somebody should have noticed it before. alex ---- Manual Page -- http://www.php.net/manual/en/language.expressions.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+55815 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55815&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55815&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55815&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55815&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55815&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55815&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+55815&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#93636) next »