Edit report at https://bugs.php.net/bug.php?id=61972&edit=1

 ID:                 61972
 Comment by:         sjon at hortensius dot net
 Reported by:        crashyn at op dot pl
 Summary:            addchild treats text as a tag
 Status:             Open
 Type:               Feature/Change Request
 Package:            SimpleXML related
 Operating System:   Windows XP
 PHP Version:        5.4.2
 Block user comment: N
 Private report:     N

 New Comment:

Shouldn't the values passed to xmlNewChild in addChild go through BAD_CAST like 
all other Xml related methods do?


Previous Comments:
------------------------------------------------------------------------
[2012-05-20 21:54:40] crashyn at op dot pl

<?php
$xml_header = "<?xml version='1.0' encoding='utf-8'?><xml/>";

$xml = new SimpleXMLElement($xml_header);
$xml->addChild("first_string","this is &lt;mystring&gt;");
$xml->addChild("second_string","this is &lt; mystring&gt;");
$xml->asXML("test.xml");
echo "<pre>" . $xml->first_string . "<br />";   // 'this is '
echo $xml->second_string . "</pre>";                    // 'this is < mystring>'
?>

------------------------------------------------------------------------
[2012-05-16 20:55:00] riptide dot tempora at opinehub dot com

Can you provide a test script and its actual vs. expected output to show 
exactly what you mean?

------------------------------------------------------------------------
[2012-05-07 21:09:58] crashyn at op dot pl

Description:
------------
---
>From manual page: http://www.php.net/simplexmlelement.addchild
---
addChild treats &lt;my_string&gt; as a tag nd removes it completely



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=61972&edit=1

Reply via email to