Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:29663 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53256 invoked by uid 1010); 22 May 2007 15:02:57 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 53241 invoked from network); 22 May 2007 15:02:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 May 2007 15:02:57 -0000 Authentication-Results: pb1.pair.com smtp.mail=kepbepos@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=kepbepos@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 64.233.184.232 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: kepbepos@gmail.com X-Host-Fingerprint: 64.233.184.232 wr-out-0506.google.com Linux 2.4/2.6 Received: from [64.233.184.232] ([64.233.184.232:5519] helo=wr-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 30/4A-15287-D1603564 for ; Tue, 22 May 2007 11:02:55 -0400 Received: by wr-out-0506.google.com with SMTP id i21so1742698wra for ; Tue, 22 May 2007 08:02:51 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=sMfwxvaoaB33gK+GtacZnnea7k4RgK8+pkSLkdOlplSYSGvTHwAl3YvcZOhKRL7ryEICmS/1NGTyr1+Wtx/Vx4DShoZvik/RyixFArYpKDqRT80eIonabDo4Tb6/KYIod5qye/tS+tf76idXI5Sq+zNHgL2UmM+oIgjK2BHw9Ic= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=EejFI9w+b8ybKqfeL5wqO3zjS1pbujVAAQSFWxQJfm50Sue39W8jlNoeOOo2Ph+byodMH/38ugksEwIa5IK1i5EvylrvOMSKRMbexE1JpKulRk9i7TTRI6ak1eBoIsXx0zZ2nvqyCr6KWFjcn9sXPQKOoU2PNQmucElLnlV0Cog= Received: by 10.114.27.20 with SMTP id a20mr3319531waa.1179846171003; Tue, 22 May 2007 08:02:51 -0700 (PDT) Received: by 10.115.16.6 with HTTP; Tue, 22 May 2007 08:02:50 -0700 (PDT) Message-ID: <799aeacc0705220802v6477968fgc5f8a83c7fb61e1d@mail.gmail.com> Date: Tue, 22 May 2007 17:02:50 +0200 To: "Vesselin Kenashkov" Cc: internals@lists.php.net In-Reply-To: <261daaa10705220123m41b254a6p6b44d21b29ad1d4c@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_102071_22625759.1179846170890" References: <261daaa10705220123m41b254a6p6b44d21b29ad1d4c@mail.gmail.com> Subject: Re: [PHP-DEV] unexpected behaviour in SimpleXML (php 5.2.2) From: kepbepos@gmail.com ("kepbepos kepbepos") ------=_Part_102071_22625759.1179846170890 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, I'm not an expert, but in your example -------- > $str = ''; > $x = new SimpleXMLElement($str); > > if($x->subnode->children()) > print 'yes'; > else > print 'no'; > --------- > will print 'no'; ok no children If the > $str=''; > it will print yes. ok has one child: But the same will happen if the subnode has an attribute like: > $str = ''; I think is correct, in fact (if I'm right) an attribute is a child. Following DOM the tree is: rootnode | subnode | id Here an example explaining that http://www.w3schools.com/dom/nodetree.gif Please someone else to confirm. See you ------=_Part_102071_22625759.1179846170890--