1--TEST-- 2DOM-Parsing GH-45 (It's possible that 'retrieve a preferred prefix string' returns a wrong prefix for the specified namespace) 3--EXTENSIONS-- 4dom 5--FILE-- 6<?php 7 8$root = Dom\XMLDocument::createFromString('<el1 xmlns:p="u1" xmlns:q="u1"><el2 xmlns:q="u2"/></el1>')->documentElement; 9$root->firstChild->setAttributeNS('u1', 'name', 'v'); 10$attr = $root->firstChild->getAttributeNodeNS("u1", "name"); 11var_dump($attr->prefix, $attr->namespaceURI); 12echo $root->ownerDocument->saveXml($root), "\n"; 13 14?> 15--EXPECT-- 16NULL 17string(2) "u1" 18<el1 xmlns:p="u1" xmlns:q="u1"><el2 xmlns:q="u2" p:name="v"/></el1> 19