From:
Operating system:
PHP version: Irrelevant
Package: SimpleXML related
Bug Type: Bug
Bug description:the result is different between php versions
Description:
------------
the result of test script below is different between php version 5.1.6 and
version 5.3.2.
Test script:
---------------
<?php
var_dump(phpversion());
$foo1 = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><root
/>');
$foo1->addChild("x", htmlspecialchars("<test />"));
$foo2 = new SimpleXMLElement('<?xml version="1.0"
encoding="UTF-8"?><root><x /></root>');
$foo2->x = htmlspecialchars("<test />");
var_dump($foo1->x);
var_dump($foo2->x);
var_dump($foo1->asXML() === $foo2->asXML());
?>
Expected result:
----------------
string(5) "5.1.6"
object(SimpleXMLElement)#3 (1) {
[0]=>
string(8) "<test />"
}
object(SimpleXMLElement)#3 (1) {
[0]=>
string(8) "<test />"
}
bool(true)
Actual result:
--------------
string(5) "5.3.2"
object(SimpleXMLElement)#3 (1) {
[0]=>
string(8) "<test />"
}
object(SimpleXMLElement)#3 (1) {
[0]=>
string(14) "<test />"
}
bool(false)
--
Edit bug report at http://bugs.php.net/bug.php?id=52553&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=52553&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=52553&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=52553&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=52553&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=52553&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=52553&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=52553&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=52553&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=52553&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=52553&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=52553&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=52553&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=52553&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=52553&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52553&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=52553&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=52553&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=52553&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=52553&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=52553&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=52553&r=mysqlcfg