1--TEST-- 2GH-17145 (DOM memory leak) 3--EXTENSIONS-- 4dom 5--CREDITS-- 6YuanchengJiang 7--SKIPIF-- 8<?php 9if (LIBXML_VERSION < 21300) die("skip Upstream libxml bug causes incorrect output, fixed in GNOME/libxml2@b8597f4"); 10?> 11--FILE-- 12<?php 13$element = new DOMElement("N", "W", "y"); 14$attr = new DOMAttr("c" , "n"); 15$doc = new DOMDocument(); 16$doc->appendChild($element); 17$element->setAttributeNodeNS($attr); 18$attr->appendChild($doc->createEntityReference('amp')); 19echo $attr->value; 20?> 21--EXPECT-- 22n& 23