Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:55053 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12830 invoked from network); 1 Sep 2011 11:10:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Sep 2011 11:10:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=rrichards@cdatazone.org; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=rrichards@cdatazone.org; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain cdatazone.org does not designate 207.58.142.213 as permitted sender) X-PHP-List-Original-Sender: rrichards@cdatazone.org X-Host-Fingerprint: 207.58.142.213 smtp2go.com Linux 2.6 Received: from [207.58.142.213] ([207.58.142.213:43879] helo=smtp2go.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 34/41-03466-D386F5E4 for ; Thu, 01 Sep 2011 07:10:53 -0400 References: <4E5F1996.4050002@liip.ch> In-Reply-To: <4E5F1996.4050002@liip.ch> Mime-Version: 1.0 (iPhone Mail 8L1) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-ID: Cc: PHPdev X-Mailer: iPhone Mail (8L1) Date: Thu, 1 Sep 2011 07:10:40 -0400 To: Christian Stocker Subject: Re: [PHP-DEV] simplexml inconsistencies in the last few releases (the same issue already discussed) From: rrichards@cdatazone.org (Rob Richards) imo new behavior in 5.3 Rob On Sep 1, 2011, at 1:35 AM, Christian Stocker wr= ote: > Hi >=20 > It's about the two tests in >=20 > http://svn.php.net/viewvc/php/php-src/branches/PHP_5_3/ext/simplexml/tests= /008.phpt > and > http://svn.php.net/viewvc/php/php-src/branches/PHP_5_3/ext/simplexml/tests= /bug48601.phpt >=20 > which contractited themself and we had back and forth commits due to this.= >=20 > So we had the following history >=20 > 5.3.0 old behaviour > ... > 5.3.3 new behaviour > ... > 5.3.7 old behaviour > ... > 5.4.0 new behaviour >=20 >=20 > The main question now is, should we introduce back the new behavior in > the 5.3 line? Since the new behaviour was already there since more than > a year, but now isn't, i'm not sure, what to do. >=20 > The good point about the new behaviour is that it's almost BC, so going > from the old to the new shouldn't cause much problems, but vice versa it > does. The reason is that if you do an valid xpath query which returns > zero results, the old behaviour returned false, the new one returns an > empty array, so before 5.3.3 you had to write >=20 > *** > $res =3D $sx->query("/some/xpath"); >=20 > if ($res) { > foreach($res as $node) {} > } > *** >=20 > Which still will work with the new behaviour, but that "if" is not > really needed with the new behaviour, so going back to the old one may > break if nothing is found (there may be problems when you asked for > "zero-results" with checking if $res is false) >=20 > Anyway, I'd appreciate some opinions about introducing back the new > beehaviour in 5.3 or not (I guess 5.3.8 wasn't the last 5.3 release :)) >=20 > chregu >=20 >=20 > --=20 > Liip AG // Feldstrasse 133 // CH-8004 Zurich > Tel +41 43 500 39 81 // Mobile +41 76 561 88 60 > www.liip.ch // blog.liip.ch // GnuPG 0x0748D5FE >=20 >=20 > --=20 > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php