3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $writer =new XMLWriter(); $writer->openURI('php://output'); $writer->setIndent(true); $writer->startDocument('1.0', 'UTF-8'); $writer->startElement('rss'); $writer->writeAttributeNS('xmlns','g', null, 'http://base.google.com/ns/1.0'); $writer->startElement('channel'); $writer->writeElement('title', 'MijnAutoOnderdelen'); $writer->endElement(); $writer->endElement(); $writer->endDocument();
based on dj9QQ
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.3.0beta1
<?xml version="1.0" encoding="UTF-8"?> <rss xmlns:g="http://base.google.com/ns/1.0"> <channel> <title>MijnAutoOnderdelen</title> </channel> </rss>
Output for hhvm-3.15.4
Warning: writeAttributeNS() expects parameter 3 to be string, null given in /in/Vaqck on line 8 <?xml version="1.0" encoding="UTF-8"?> <rss> <channel> <title>MijnAutoOnderdelen</title> </channel> </rss>