Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33870 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43918 invoked by uid 1010); 8 Dec 2007 20:15:31 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 43903 invoked from network); 8 Dec 2007 20:15:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Dec 2007 20:15:31 -0000 Authentication-Results: pb1.pair.com header.from=marco.kaiser@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=marco.kaiser@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 64.233.162.231 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: marco.kaiser@gmail.com X-Host-Fingerprint: 64.233.162.231 nz-out-0506.google.com Received: from [64.233.162.231] ([64.233.162.231:14403] helo=nz-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5B/D9-51488-26BFA574 for ; Sat, 08 Dec 2007 15:15:30 -0500 Received: by nz-out-0506.google.com with SMTP id x7so402830nzc for ; Sat, 08 Dec 2007 12:15:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=dYs6K5Y8CV07Rw1K494WNWvjVSTrghi9SCmrTrGYpi8=; b=Qg0TYJVk9B6aoBRecVPRdQS0AK/id45IAr9i0/Eq7tOIuVzdQb3/+xuU6QaUl4xl7H8XEjWeh0aCC8FPQX/5prh4U7L6++86T/mIBeIXeDc1nA/hk7M9FF4njzmMDZW3WPvfPE9h4KqqrZaIYzqIo6ZMP92ukbe85F0XVpYpqqM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=vCPj7QfEGdchWVAlVSDZvS9/U34udsZAPWiU4VlbIlWSJtKDEZZyposrJhW40IeVjnKxU6lDGqCkZ2twUpyAJIBebfDpsRwMm98mqwYgcGnwTWuci99dckUExjWqikBhJMuB7eBqEpYM492bqk5GHlcUbNeiwSFyG9JrLoeh4h8= Received: by 10.150.215.16 with SMTP id n16mr1659075ybg.1197144924704; Sat, 08 Dec 2007 12:15:24 -0800 (PST) Received: by 10.150.157.12 with HTTP; Sat, 8 Dec 2007 12:15:24 -0800 (PST) Message-ID: Date: Sat, 8 Dec 2007 21:15:24 +0100 To: "Frank M. Kromann" Cc: internals@lists.php.net In-Reply-To: <11970653983080000@9866357972520000.9866341568840000> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2604_25799081.1197144924691" References: <11970653983080000@9866357972520000.9866341568840000> Subject: Re: [PHP-DEV] PHP 5.3 bug or changed feature?? From: marco.kaiser@gmail.com ("Marco Kaiser") ------=_Part_2604_25799081.1197144924691 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Frank, please open a bugreport about this issue. This would start the internal process of verifying this. -- Marco On Dec 7, 2007 11:09 PM, Frank M. Kromann wrote: > Hello Everyon, > > Casting a SimpleXML object to an array gives different results in PHP > 5.2.5 and PHP 5.3-dev. > > Source: > > $xml = simplexml_load_file("sample.xml"); > > foreach($xml->column as $column) { > var_dump($column); > var_dump((array)$column); > } > > sample.xml > > ?xml version="1.0"?> > > > cv > entsimp > > > pp > sc > > > > PHP 5.2 output: > object(SimpleXMLElement)#4 (2) { > ["@attributes"]=> > array(1) { > ["name"]=> > string(13) "ENTERTAINMENT" > } > ["module"]=> > array(2) { > [0]=> > string(2) "cv" > [1]=> > string(7) "entsimp" > } > } > array(2) { > ["@attributes"]=> > array(1) { > ["name"]=> > string(13) "ENTERTAINMENT" > } > ["module"]=> > array(2) { > [0]=> > string(2) "cv" > [1]=> > string(7) "entsimp" > } > } > object(SimpleXMLElement)#5 (2) { > ["@attributes"]=> > array(1) { > ["name"]=> > string(12) "SEAT CONTROL" > } > ["module"]=> > array(2) { > [0]=> > string(2) "pp" > [1]=> > string(2) "sc" > } > } > array(2) { > ["@attributes"]=> > array(1) { > ["name"]=> > string(12) "SEAT CONTROL" > } > ["module"]=> > array(2) { > [0]=> > string(2) "pp" > [1]=> > string(2) "sc" > } > } > > PHP 5.3 output: > > object(SimpleXMLElement)#4 (2) { > ["@attributes"]=> > array(1) { > ["name"]=> > string(13) "ENTERTAINMENT" > } > ["module"]=> > array(2) { > [0]=> > string(2) "cv" > [1]=> > string(7) "entsimp" > } > } > array(1) { > ["module"]=> > array(2) { > [0]=> > string(2) "cv" > [1]=> > string(7) "entsimp" > } > } > object(SimpleXMLElement)#5 (2) { > ["@attributes"]=> > array(1) { > ["name"]=> > string(12) "SEAT CONTROL" > } > ["module"]=> > array(2) { > [0]=> > string(2) "pp" > [1]=> > string(2) "sc" > } > } > array(1) { > ["module"]=> > array(2) { > [0]=> > string(2) "pp" > [1]=> > string(2) "sc" > } > } > > Not that the attributes are gone when SimpleXML objects are converted in > PHP 5.3. Is this a bug or a feature change? > > - Frank > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Marco Kaiser ------=_Part_2604_25799081.1197144924691--