Hello D.,
Friday, May 12, 2006, 5:29:42 AM, you wrote:
> I've recently upgraded to PHP 5.1.4 from 5.1.2 and noticed that in 5.1.3
> there were changes made to SimpleXML. Now, when I touch an element
> which didn't used to exist, instead of acting like it didn't exist, it
> creates it! That's horrible!
> Well, this used to work:
> <?php
> $xmlstr = "<test><item>1</item></test>";
> $xml = simplexml_load_string($xmlstr);
> print_r($xml);
> foreach ($xml->nonexist as $nonexist) {
> // do nothing
> }
> print_r($xml);
?>>
> But now, the output of the print_r is different when I do it the second
> time because the foreach statement created nodes:
> SimpleXMLElement Object
> (
> [item] => 1
> )
> SimpleXMLElement Object
> (
> [item] => 1
> [nonexist] => SimpleXMLElement Object
> (
> )
> )
> I think that's a bug and not a feature. Why was this changed?
It is called write support. I think we are going to add a flag
so that one can specify whether write support is enabled or not.
--
Best regards,
Marcus mailto:[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php