|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-09-19 16:55 UTC] derick@php.net
[2006-09-27 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 07:00:01 2025 UTC |
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: --------------