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

print $xml_element->asXML();

?>
===DONE===
--EXPECT--
a &#38; b
a &#38; b
a & b
a & b
<?xml version="1.0"?>
<root><node1>a &amp;#38; b</node1><node2>a &amp; b</node2></root>
===DONE===