Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33883 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1596 invoked by uid 1010); 9 Dec 2007 13:52:01 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 1581 invoked from network); 9 Dec 2007 13:52:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Dec 2007 13:52:01 -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.170.187 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.170.187 rn-out-0910.google.com Linux 2.4/2.6 Received: from [64.233.170.187] ([64.233.170.187:8170] helo=rn-out-0102.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F5/46-51375-003FB574 for ; Sun, 09 Dec 2007 08:52:01 -0500 Received: by rn-out-0102.google.com with SMTP id e5so129190rng for ; Sun, 09 Dec 2007 05:51:58 -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=WjO08bln5qCEvRkga1CqVDOmc6wkSMPCmHGKSGzEKNI=; b=t7Ik/d+vUtUQsowOw7Jv9q1nvN2eGjs8q0vsfLw1btW+WnIMoqzxLZ4HVacSnzGDZ+47JKVwC9qoN3ljqb34MYwT5DmXJC+zRE3Y/Iz2sP3EimWwGOoyvDaIkhEdU6N6ki29J9G2YxuDjrZdangAZ0Wth1XCovpJzR83toXyNSg= 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=CID3cgtnbefZxW/OrONnT1zx02erUO61Uq6sLqtQl0N6CjHj2ORgniQvXWAauqmj0c/iHdLxVzdF5pu5LziJ1/Zj16G2ajcUwpz+AtiHjrTRWCyYS/3T/ao0uPOK6XEOM5BCSGdIu1SwWYw2N43KA/HF8djNFD6tLvwhe7sMA7c= Received: by 10.150.12.5 with SMTP id 5mr128047ybl.1197208318308; Sun, 09 Dec 2007 05:51:58 -0800 (PST) Received: by 10.150.157.12 with HTTP; Sun, 9 Dec 2007 05:51:58 -0800 (PST) Message-ID: Date: Sun, 9 Dec 2007 14:51:58 +0100 To: "Rob Richards" Cc: "Frank M. Kromann" , internals@lists.php.net, helly@php.net In-Reply-To: <475BDDF1.7040605@ctindustries.net> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2819_3376365.1197208318313" References: <11970653983080000@9866357972520000.9866341568840000> <475BDDF1.7040605@ctindustries.net> Subject: Re: [PHP-DEV] PHP 5.3 bug or changed feature?? From: marco.kaiser@gmail.com ("Marco Kaiser") ------=_Part_2819_3376365.1197208318313 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline This happens with many more functions. So i can verify this bug. php -r "echo md5(serialize(simplexml_load_file('example.xml'))) . PHP_EOL . phpversion() . PHP_EOL;" Output PHP 5.2.5: a6d7776fcb0e9c085b0d5972df792dac 5.2.5 Output PHP 5.3.0-dev (latest snap) 3e442cb7c8507c8941011735bb46e6de 5.3.0-dev -- Marco On Dec 9, 2007 1:22 PM, Rob Richards wrote: > Hi Frank, > > 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. > > > This is due to the implementation of the get_debug_info handler merged > from HEAD. > The same result happens when calling get_object_vars on a > SimpleXMLElement object. > > Marcus, was it intended to only include @attributes with print_r/var_dump? > > Rob > > 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_2819_3376365.1197208318313--