3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <smses count="1099"> <sms protocol="0" address="" date="" type="" subject="" body="" toa="null" sc_toa="null" service_center="null" read="1" status="-1" locked="0" date_sent="null" readable_date="" contact_name="" /> </smses> XML; $dom = new DOMDocument(); $dom->loadXML($xml); $smses = $smses->getElementsByTagName('sms'); foreach ($smses as $sms) { foreach ($sms->attributes as $attr) { $name = $attr->nodeName; $value = $attr->nodeValue; echo "Attribute '$name' :: '$value'"; } }
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $smses in /in/S2ffK on line 14 Fatal error: Uncaught Error: Call to a member function getElementsByTagName() on null in /in/S2ffK:14 Stack trace: #0 {main} thrown in /in/S2ffK on line 14
Process exited with code 255.

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