php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38885 Method DOMElement->hasAttribute() (sometimes) does not work
Submitted: 2006-09-19 16:46 UTC Modified: 2006-09-27 01:00 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: lhaire at lettres dot unige dot ch Assigned:
Status: No Feedback Package: DOM XML related
PHP Version: 5.1.6 OS: Mandriva Linux/PREFORK-13.3.2006
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: lhaire at lettres dot unige dot ch
New email:
PHP Version: OS:

 

 [2006-09-19 16:46 UTC] lhaire at lettres dot unige dot ch
Description:
------------
The above method returns false when it was supposed to be true... PHP version: 5.0.4 (the latest in my Mandrake distribution)

Reproduce code:
---------------
$human = $item->getElementsByTagName('HUMAN_CORR');
$nhum = $human->length;
if ($nhum >0){
  $j =0;

  while (($j < $nhum)     &&(!$human->item($j)->hasAttribute('expert'))
	$j++;

Expected result:
----------------
This code works:

 $j =0;
			while (($j < $nhum) && ($human->item($j)->getAttribute('expert') != 'yes'))
				$j++;

here is a short xml sample:
<HUMAN_CORR index="h1" itemTag="i00018" correctchoice="yes">confortable</HUMAN_CORR>
<HUMAN_CORR index="he_5" itemTag="i00018" expert="yes" correctchoice="yes">? l'aise</HUMAN_CORR>

Actual result:
--------------
 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-19 16:55 UTC] derick@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip
 [2006-09-27 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Aug 20 15:01:55 2019 UTC