Doc #64412 [Opn->Fbk]: empty array evaluates to true instead of false

From: Date: Tue, 12 Mar 2013 15:24:40 +0000
Subject: Doc #64412 [Opn->Fbk]: empty array evaluates to true instead of false
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-9650@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=64412&edit=1

 ID:                 64412
 Updated by:         rasmus@php.net
 Reported by:        confidential99 at gmail dot com
 Summary:            empty array evaluates to true instead of false
-Status:             Open
+Status:             Feedback
 Type:               Documentation Problem
 Package:            Arrays related
 Operating System:   Linux
 PHP Version:        Irrelevant
 Block user comment: N
 Private report:     N

 New Comment:

It should definitely be false. I get false under both PHP 5.3 and 5.4. Which 
version are you on?


Previous Comments:
------------------------------------------------------------------------
[2013-03-12 13:23:47] confidential99 at gmail dot com

Description:
------------
The manual (http://www.php.net/manual/en/language.types.boolean.php) states that 
an empty array should evaluate to false. 

When I run the following code, it evaluates to true. I'm filing this under 
documentation bug because I'm not sure if this is intended or not.


Test script:
---------------
var_dump((bool) array());



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64412&edit=1


Thread (4 messages)

« previous php.doc.bugs (#9650) next »