xref: /PHP-7.2/ext/simplexml/tests/bug44478.phpt (revision f1d7e3ca)
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 &#38; b';
9print $xml_element->node1."\n";
10$xml_element->node1 = 'a &#38; b';
11print $xml_element->node1."\n";
12$xml_element->addChild('node2','a &#38; 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 &#38; b
23a &#38; b
24a & b
25a & b
26<?xml version="1.0"?>
27<root><node1>a &amp;#38; b</node1><node2>a &amp; b</node2></root>
28===DONE===
29
30