Open
Description
Description
The following code:
<?php
$xml = "<root><first/><second/><third/></root>";
$xml = simplexml_load_string($xml);
var_dump($xml->first == $xml->second);
Resulted in this output:
bool(true)
But I expected this output instead:
bool(false)
It's because the wrong node is fetched, i.e. it doesn't take into account the iterating nature of the simple xml objects. PoC fix patch (needs more testing and thinking): https://gist.github.com/nielsdos/f8e232836d72e68c5d3418116ddad877
PHP Version
PHP 5.0.0-master
Operating System
Linux