--TEST-- SimpleXMLElement->addAttribute() --SKIPIF-- --FILE-- addAttribute('type','novels'); var_dump($simple->attributes()); echo "Done"; ?> --EXPECT-- object(SimpleXMLElement)#2 (1) { ["@attributes"]=> array(1) { ["type"]=> string(6) "novels" } } Done