3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<?xml version="1.0" encoding="UTF-8"?> <root>Тест кириллицы</root> '; $original = new DOMDocument; $original->loadXML($xml); echo $original->saveXML(); echo PHP_EOL . PHP_EOL; // this is code from \SebastianBergmann\Comparator\DOMNodeComparator::nodeToText $document = new DOMDocument; @$document->loadXML($original->C14N()); echo $document->saveXML(); echo PHP_EOL . PHP_EOL; // if I add utf-8 xml header then document is good $document = new DOMDocument; @$document->loadXML('<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL . $original->C14N()); echo $document->saveXML();
Output for git.master, git.master_jit, rfc.property-hooks
<?xml version="1.0" encoding="UTF-8"?> <root>Тест кириллицы</root> <?xml version="1.0"?> <root>&#x422;&#x435;&#x441;&#x442; &#x43A;&#x438;&#x440;&#x438;&#x43B;&#x43B;&#x438;&#x446;&#x44B;</root> <?xml version="1.0" encoding="UTF-8"?> <root>Тест кириллицы</root>

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
19.16 ms | 406 KiB | 5 Q