3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s = '<root> <Formula> <formulaname attr="1.0">Basic</formulaname> <movespeed>1</movespeed> <box>4</box> <chicken>3</chicken> <ducks> <duck>test1</duck> <duck a="b">test2</duck> <duck>test3</duck> </ducks> <cereal>2</cereal> </Formula> </root>'; $xml = simplexml_load_string($s); $arr = (array) $xml; $newArr = (array)$arr['Formula']; var_dump($newArr['ducks'], $arr['Formula']->ducks->next());
Output for git.master, git.master_jit, rfc.property-hooks
object(SimpleXMLElement)#3 (1) { ["duck"]=> array(3) { [0]=> string(5) "test1" [1]=> string(5) "test2" [2]=> string(5) "test3" } } NULL

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