#42082 [Opn->Csd]: NodeList length zero should be empty
| From: | rrichards@php.net | Date: | Mon, 06 Aug 2007 16:24:10 +0000 |
| Subject: | #42082 [Opn->Csd]: NodeList length zero should be empty | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-115805@lists.php.net to get a copy of this message | ||
ID: 42082
Updated by: rrichards@php.net
Reported By: ms419 at freezone dot co dot uk
-Status: Open
+Status: Closed
Bug Type: DOM XML related
Operating System: Debian unstable
PHP Version: 5.2.3
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2007-07-23 19:17:20] ms419 at freezone dot co dot uk
Description:
------------
When NodeList length is int(0), empty($nodes->length) should be true
Reproduce code:
---------------
<?php
$doc = new DOMDocument();
$xpath = new DOMXPath($doc);
$nodes = $xpath->query('*');
var_dump($nodes);
var_dump($nodes->length);
var_dump(empty($nodes->length));
Expected result:
----------------
ket% php tmp.php
object(DOMNodeList)#3 (0) {
}
int(0)
bool(true)
ket%
Actual result:
--------------
ket% php tmp.php
object(DOMNodeList)#3 (0) {
}
int(0)
bool(false)
ket%
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42082&edit=1