3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<?xml version="1.0" encoding="UTF-8"?><svg width="1840.71in" height="2057.42in" viewBox="0 -340 1840.71 2057.42" version="1.1" xmlns="http://www.w3.org/2000/svg" style="stroke-linecap:round;stroke-linejoin:round;fill:none" xmlns:qs="http://xmeasures.com/qs/elements/1.0/"> <text x="22" dx="0" y="-317.43" dy="13.33" font-family="Arial" font-size="18.67" line-height="1.1" fill="#000000" transform="rotate(360 22,-317.43)" text-anchor="start" qs:layer="T-Content">&quot;Client&quot;:</text> <text x="686.64" dx="0" y="-218.92" dy="16" font-family="Arial" font-size="22.4" line-height="1.1" fill="#000000" transform="rotate(360 686.64,-218.92)" text-anchor="start" qs:layer="T-Content">Version:</text> <text x="22" dx="0" y="-277.44" dy="13.33" font-family="Arial" font-size="18.67" line-height="1.1" fill="#000000" transform="rotate(360 22,-277.44)" text-anchor="start" qs:layer="T-Content">Project Name:</text> <text x="22" dx="0" y="-157.43" dy="13.33" font-family="Arial" font-size="18.67" line-height="1.1" fill="#000000" transform="rotate(360 22,-157.43)" text-anchor="start" qs:layer="T-Content">Date Created:</text> <text x="166" dx="0" y="-316.75" dy="13.33" font-family="Arial" font-size="18.67" line-height="1.1" fill="#000000" transform="rotate(360 166,-316.75)" text-anchor="start" qs:layer="T-Project Info">xxxxx</text> <text x="322" dx="0" y="-157.43" dy="13.33" font-family="Arial" font-size="18.67" line-height="1.1" fill="#000000" transform="rotate(360 322,-157.43)" text-anchor="start" qs:layer="T-Content">Date Revised:</text> <text x="22" dx="0" y="-237.43" dy="13.33" font-family="Arial" font-size="18.67" line-height="1.1" fill="#000000" transform="rotate(360 22,-237.43)" text-anchor="start" qs:layer="T-Content">Address:</text> <text x="166" dx="0" y="-237.43" dy="13.33" font-family="Arial" font-size="18.67" line-height="1.1" fill="#000000" transform="rotate(360 166,-237.43)" text-anchor="start" qs:layer="T-Project Info">xxxxx</text> <text x="760" dx="0" y="-263.39" dy="24" font-family="Arial" font-weight="bold" font-size="33.6" line-height="1.1" fill="#000000" transform="rotate(360 760,-263.39)" text-anchor="middle" qs:layer="T-Floor ID">Floor 1</text> <text x="833.36" dx="0" y="-218.93" dy="16" font-family="Arial" font-style="italic" font-size="22.4" line-height="1.1" fill="#ff0000" transform="rotate(360 833.36,-218.93)" text-anchor="end" qs:layer="T-Floor Plan Version">xxxxx</text> <text x="22" dx="0" y="-197.44" dy="13.33" font-family="Arial" font-size="18.67" line-height="1.1" fill="#000000" transform="rotate(360 22,-197.44)" text-anchor="start" qs:layer="T-Content">City, Prov/State:</text> <text x="165.59" dx="0" y="-197.44" dy="13.33" font-family="Arial" font-size="18.67" line-height="1.1" fill="#000000" transform="rotate(360 165.59,-197.44)" text-anchor="start" qs:layer="T-Project Info">xxxxxxx</text> <text x="166" dx="0" y="-277.44" dy="13.33" font-family="Arial" font-size="18.67" line-height="1.1" fill="#000000" transform="rotate(360 166,-277.44)" text-anchor="start" qs:layer="T-Project Info">N/A</text> </svg>'; $document = new \DOMDocument(); $document->loadXML($xml); $xpath = new \DOMXPath($document); $regNS = $xpath->registerNamespace("svg","http://www.w3.org/2000/svg"); $regNS2 = $xpath->registerNamespace("qs","http://xmeasures.com/qs/elements/1.0/"); $xpath1 = $xpath->query("//@qs:layer"); var_dump($xpath1); $xpath2 = $xpath->query("//text[@*='T-Content']"); var_dump($xpath2);
Output for git.master, git.master_jit, rfc.property-hooks
object(DOMNodeList)#16 (1) { ["length"]=> int(13) } object(DOMNodeList)#17 (1) { ["length"]=> int(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:
61.49 ms | 401 KiB | 8 Q