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--EXPECT-- 21a & b 22a & b 23a & b 24a & b 25<?xml version="1.0"?> 26<root><node1>a &#38; b</node1><node2>a & b</node2></root> 27 28