--TEST-- Bug #43221 (SimpleXML adding default namespace in addAttribute) --SKIPIF-- --FILE-- '); $n = $xml->addChild("node", "value"); $n->addAttribute("a", "b"); $n->addAttribute("c", "d", "http://bar.com"); $n->addAttribute("foo:e", "f", "http://bar.com"); print_r($xml->asXml()); ?> --EXPECTF-- Warning: SimpleXMLElement::addAttribute(): Attribute requires prefix for namespace in %sbug43221.php on line %d value