1--TEST-- 2xmlwriter_write_attribute_ns with missing param 3--SKIPIF-- 4<?php if (!extension_loaded("xmlwriter")) print "skip"; ?> 5--FILE-- 6<?php 7$xw = xmlwriter_open_memory(); 8xmlwriter_set_indent($xw, TRUE); 9xmlwriter_start_document($xw, NULL, "UTF-8"); 10xmlwriter_start_element($xw, 'root'); 11xmlwriter_write_attribute_ns($xw, 'prefix', '', 'http://www.php.net/uri'); 12xmlwriter_start_element($xw, 'elem1'); 13xmlwriter_write_attribute($xw, 'attr1', 'first'); 14xmlwriter_end_element($xw); 15xmlwriter_full_end_element($xw); 16xmlwriter_end_document($xw); 17 18$output = xmlwriter_flush($xw, true); 19print $output; 20 21// write attribute_ns without start_element first 22$xw = xmlwriter_open_memory(); 23var_dump(xmlwriter_write_attribute_ns($xw, 'prefix', 'id', 'http://www.php.net/uri', 'elem1')); 24print xmlwriter_output_memory($xw); 25?> 26--CREDITS-- 27Koen Kuipers koenk82@gmail.com 28--EXPECTF-- 29 30Warning: xmlwriter_write_attribute_ns() expects exactly %d parameters, %d given in %s on line %d 31<?xml version="1.0" encoding="UTF-8"?> 32<root> 33 <elem1 attr1="first"/> 34</root>%wbool(false) 35