3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo1 = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><root />'); $foo1->addChild("x", htmlspecialchars("<test />")); $foo2 = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><root><x /></root>'); $foo2->x = htmlspecialchars("<test />"); var_dump($foo1->x); var_dump($foo2->x); var_dump($foo1->asXML() === $foo2->asXML());
Output for git.master, git.master_jit, rfc.property-hooks
object(SimpleXMLElement)#3 (1) { [0]=> string(8) "<test />" } object(SimpleXMLElement)#3 (1) { [0]=> string(14) "&lt;test /&gt;" } bool(false)

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:
41.34 ms | 401 KiB | 8 Q