php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35342 isset(DOMNodeList->length) returns false
Submitted: 2005-11-22 23:38 UTC Modified: 2005-11-23 09:23 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: bjori@php.net Assigned: rrichards
Status: Closed Package: DOM XML related
PHP Version: 5.1.0RC6 OS: FreeBSD
Private report: No CVE-ID:
 [2005-11-22 23:38 UTC] bjori@php.net
Description:
------------
isset($DOMNodeList->length) seems to return false, all the time.

Reproduce code:
---------------
<?php
    $DOMDocument = new DOMDocument;
    $DOMDocument->loadXML("<root><foo>foobar</foo><foo>foobar#2</foo></root>");

    $DOMNodeList = $DOMDocument->getElementsByTagName("foo");

    var_dump($DOMNodeList->length, isset($DOMNodeList->length));
?>

Expected result:
----------------
int(2) bool(true) 

Actual result:
--------------
int(2) bool(false) 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-22 23:43 UTC] tony2001@php.net
Assigned to the maintainer.
 [2005-11-23 04:14 UTC] rrichards@php.net
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.


 [2005-11-23 08:39 UTC] bjori@php.net
Your fix doesnt seem to compile:

/bin/sh /usr/src/php51/libtool --preserve-dup-deps --mode=compile gcc  -Iext/dom/ -I/usr/src/php51/ext/dom/ -DPHP_ATOM_INC -I/usr/src/php51/include -I/usr/src/php51/main -I/usr/src/php51 -I/usr/local/include/libxml2 -I/usr/local/include -I/usr/src/php51/ext/date/lib -I/usr/src/php51/TSRM -I/usr/src/php51/Zend    -g -Wall  -prefer-non-pic -c /usr/src/php51/ext/dom/php_dom.c -o ext/dom/php_dom.lo
 gcc -Iext/dom/ -I/usr/src/php51/ext/dom/ -DPHP_ATOM_INC -I/usr/src/php51/include -I/usr/src/php51/main -I/usr/src/php51 -I/usr/local/include/libxml2 -I/usr/local/include -I/usr/src/php51/ext/date/lib -I/usr/src/php51/TSRM -I/usr/src/php51/Zend -g -Wall -c /usr/src/php51/ext/dom/php_dom.c -o ext/dom/.libs/php_dom.o
/usr/src/php51/ext/dom/php_dom.c: In function `dom_objects_set_class':
/usr/src/php51/ext/dom/php_dom.c:974: error: structure has no member named `guards'
*** Error code 1

 [2005-11-23 09:23 UTC] bjori@php.net
Sorry, never mind me. My sources were bad.
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sat Apr 19 01:01:59 2014 UTC