3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xmlStr = '<?xml version="1.0"?><toplevel><CompleteSuggestion><suggestion data="ski360"/></CompleteSuggestion><CompleteSuggestion><suggestion data="ski 39"/></CompleteSuggestion><CompleteSuggestion><suggestion data="ski35"/></CompleteSuggestion><CompleteSuggestion><suggestion data="ski 3000"/></CompleteSuggestion><CompleteSuggestion><suggestion data="ski 33"/></CompleteSuggestion><CompleteSuggestion><suggestion data="ski 34"/></CompleteSuggestion></toplevel>'; $xmlObj = simplexml_load_string(utf8_encode($xmlStr)); var_dump($xmlObj); $xmlArr = objectsIntoArray($xmlObj); var_dump($xmlArr); function objectsIntoArray($arrObjData, $arrSkipIndices = array()) { $arrData = array(); if (is_object($arrObjData)) { $arrObjData = get_object_vars($arrObjData); } return $arrData; }
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Function utf8_encode() is deprecated in /in/nbqO7 on line 4 object(SimpleXMLElement)#1 (1) { ["CompleteSuggestion"]=> array(6) { [0]=> object(SimpleXMLElement)#2 (1) { ["suggestion"]=> object(SimpleXMLElement)#8 (1) { ["@attributes"]=> array(1) { ["data"]=> string(6) "ski360" } } } [1]=> object(SimpleXMLElement)#3 (1) { ["suggestion"]=> object(SimpleXMLElement)#8 (1) { ["@attributes"]=> array(1) { ["data"]=> string(6) "ski 39" } } } [2]=> object(SimpleXMLElement)#4 (1) { ["suggestion"]=> object(SimpleXMLElement)#8 (1) { ["@attributes"]=> array(1) { ["data"]=> string(5) "ski35" } } } [3]=> object(SimpleXMLElement)#5 (1) { ["suggestion"]=> object(SimpleXMLElement)#8 (1) { ["@attributes"]=> array(1) { ["data"]=> string(8) "ski 3000" } } } [4]=> object(SimpleXMLElement)#6 (1) { ["suggestion"]=> object(SimpleXMLElement)#8 (1) { ["@attributes"]=> array(1) { ["data"]=> string(6) "ski 33" } } } [5]=> object(SimpleXMLElement)#7 (1) { ["suggestion"]=> object(SimpleXMLElement)#8 (1) { ["@attributes"]=> array(1) { ["data"]=> string(6) "ski 34" } } } } } array(0) { }

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:
43.34 ms | 405 KiB | 8 Q