3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<artists page="1" perPage="100" totalPages="253081" total="25308020"> <artist> <name>David Bowie</name> <playcount>151727648</playcount> <listeners>3969219</listeners> <mbid>5441c29d-3602-4898-b1a1-b77fa23b8e50</mbid> <url>http://www.last.fm/music/David+Bowie</url> <streamable>0</streamable> <image size="small"> http://img2-ak.lst.fm/i/u/34s/937d62bb145040b9b709319c1e680037.png </image> <image size="medium"> http://img2-ak.lst.fm/i/u/64s/937d62bb145040b9b709319c1e680037.png </image> <image size="large"> http://img2-ak.lst.fm/i/u/174s/937d62bb145040b9b709319c1e680037.png </image> <image size="extralarge"> http://img2-ak.lst.fm/i/u/300x300/937d62bb145040b9b709319c1e680037.png </image> <image size="mega"> http://img2-ak.lst.fm/i/u/937d62bb145040b9b709319c1e680037.png </image> </artist> <artist> <name>The Beatles</name> <playcount>456495139</playcount> <listeners>3986977</listeners> <mbid>b10bbbfc-cf9e-42e0-be17-e2c3e1d2600d</mbid> <url>http://www.last.fm/music/The+Beatles</url> <streamable>0</streamable> <image size="small"> http://img2-ak.lst.fm/i/u/34s/55efc33bcd234fd8a1d65b3d49bf9661.png </image> <image size="medium"> http://img2-ak.lst.fm/i/u/64s/55efc33bcd234fd8a1d65b3d49bf9661.png </image> <image size="large"> http://img2-ak.lst.fm/i/u/174s/55efc33bcd234fd8a1d65b3d49bf9661.png </image> <image size="extralarge"> http://img2-ak.lst.fm/i/u/300x300/55efc33bcd234fd8a1d65b3d49bf9661.png </image> <image size="mega"> http://img2-ak.lst.fm/i/u/55efc33bcd234fd8a1d65b3d49bf9661.png </image> </artist> </artists>'; $doc = new DOMDocument(); $doc->loadXML($xml, LIBXML_PARSEHUGE); $artists = $doc->getElementsByTagName('artist'); foreach($artists as $artist) { $name = $artist>getElementsByTagName('name')->item(0)->nodeValue; var_dump($name); }
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function getElementsByTagName() in /in/1W0uQ:56 Stack trace: #0 {main} thrown in /in/1W0uQ on line 56
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:
44.74 ms | 401 KiB | 8 Q