Re: simplexml inconsistencies in the last few releases (the same issue already discussed)

From: Date: Thu, 01 Sep 2011 14:00:17 +0000
Subject: Re: simplexml inconsistencies in the last few releases (the same issue already discussed)
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-55058@lists.php.net to get a copy of this message
Hi Ok, it's committed chregu On 01.09.11 13:10, Rob Richards wrote: > imo new behavior in 5.3 > > Rob > > On Sep 1, 2011, at 1:35 AM, Christian Stocker <christian.stocker@liip.ch> wrote: > >> Hi >> >> It's about the two tests in >> >> >> 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 >> >> which contractited themself and we had back and forth commits due to this. >> >> So we had the following history >> >> 5.3.0 old behaviour >> ... >> 5.3.3 new behaviour >> ... >> 5.3.7 old behaviour >> ... >> 5.4.0 new behaviour >> >> >> 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. >> >> 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 >> >> *** >> $res = $sx->query("/some/xpath"); >> >> if ($res) { >> foreach($res as $node) {} >> } >> *** >> >> 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) >> >> 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 :)) >> >> chregu >> >> >> -- >> 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 >> >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php -- 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

« previous php.internals (#55058) next »