3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $xml = new XMLWriter(); $xml->openMemory(); $xml->startElement('parent'); $xml->writeElement('child'); $xml->writeAttribute('parentAttribute'); $xml->endElement(); echo $xml->outputMemory();
based on 7re6h
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.0
Warning: XMLWriter::writeAttribute() expects exactly 2 parameters, 1 given in /in/vd6Qu on line 8 <parent><child/></parent>