1--TEST-- 2Bug #44478 (Inconsistent behaviour when assigning new nodes) 3--SKIPIF-- 4<?php if (!extension_loaded("simplexml")) print "skip"; ?> 5--FILE-- 6<?php 7$xml_element = new simpleXMLElement('<root></root>'); 8$xml_element->node1 = 'a & b'; 9print $xml_element->node1."\n"; 10$xml_element->node1 = 'a & b'; 11print $xml_element->node1."\n"; 12$xml_element->addChild('node2','a & b'); 13print $xml_element->node2."\n"; 14$xml_element->node2 = 'a & b'; 15print $xml_element->node2."\n"; 16 17print $xml_element->asXML(); 18 19?> 20===DONE=== 21--EXPECTF-- 22a & b 23a & b 24a & b 25a & b 26<?xml version="1.0"?> 27<root><node1>a &#38; b</node1><node2>a & b</node2></root> 28===DONE=== 29 30