|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull Requests
Pull requests: HistoryAllCommentsChangesGit/SVN commits              [2020-03-05 08:05 UTC] cmb@php.net
  [2020-03-05 08:30 UTC] nikic@php.net
  [2020-06-16 12:16 UTC] cmb@php.net
 
-Assigned To:
+Assigned To: cmb
  [2020-06-16 12:16 UTC] cmb@php.net
  [2020-06-16 12:17 UTC] cmb@php.net
  [2020-06-16 13:49 UTC] cmb@php.net
 
-Summary: XmlWriter::writeAttributeNS produces bad XML with
          null prefix
+Summary: xmlwriter_write_attribute_ns: $prefix should be    
          nullable
-Type:    Bug
+Type:    Feature/Change Request
  [2020-06-16 13:49 UTC] cmb@php.net
  [2020-06-16 13:52 UTC] cmb@php.net
 
-Status: Assigned
+Status: Closed
  [2020-06-16 13:52 UTC] cmb@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 06:00:01 2025 UTC | 
Description: ------------ When passing a `$prefix = null` to `XMLWriter::writeAttributeNs`, it behaves as if empty string was passed, producing a non-well-formed XML document. Same issue happens with `startAttributeNS` method but it works fine for methods for creating elements. Test script: --------------- <?php $writer = new XMLWriter; $writer->openMemory(); $writer->setIndent(true); $writer->startElement('foo'); $writer->writeAttributeNS(null, 'test', null, 'test'); // $writer->startAttributeNS(null, 'test', null); // $writer->text('test'); // $writer->endAttribute(); $writer->endElement(); echo $writer->outputMemory(); Expected result: ---------------- <foo test="test"/> Actual result: -------------- <foo :test="test"/>