3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<td class="t_ip">104.131.248.140</td><td class="t_port"> <script type="text/javascript"> //<![CDATA[ document.write(BigBlind^BigBlind^60088); //]]> </script>50088 </td><td class="t_type"> 5 </td><td class="t_ip">79.101.32.14</td><td class="t_port"> <script type="text/javascript"> //<![CDATA[ document.write(Polymorth^Polymorth^1080); //]]> </script>45080 </td>'; $dom = new DOMDocument; $dom->loadHTML($html); $root = $dom->documentElement; $tds = $root->getElementsByTagName("td"); print_r($tds); foreach($tds as $key => $value){ print_r($value); echo $value->parentNode->textContent."\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
DOMNodeList Object ( [length] => 5 ) DOMElement Object ( [schemaTypeInfo] => [tagName] => td [firstElementChild] => [lastElementChild] => [childElementCount] => 0 [previousElementSibling] => [nextElementSibling] => (object value omitted) [nodeName] => td [nodeValue] => 104.131.248.140 [nodeType] => 1 [parentNode] => (object value omitted) [childNodes] => (object value omitted) [firstChild] => (object value omitted) [lastChild] => (object value omitted) [previousSibling] => [nextSibling] => (object value omitted) [attributes] => (object value omitted) [ownerDocument] => (object value omitted) [namespaceURI] => [prefix] => [localName] => td [baseURI] => [textContent] => 104.131.248.140 ) 104.131.248.140 //<![CDATA[ document.write(BigBlind^BigBlind^60088); //]]> 50088 5 79.101.32.14 //<![CDATA[ document.write(Polymorth^Polymorth^1080); //]]> 45080 DOMElement Object ( [schemaTypeInfo] => [tagName] => td [firstElementChild] => (object value omitted) [lastElementChild] => (object value omitted) [childElementCount] => 1 [previousElementSibling] => (object value omitted) [nextElementSibling] => (object value omitted) [nodeName] => td [nodeValue] => //<![CDATA[ document.write(BigBlind^BigBlind^60088); //]]> 50088 [nodeType] => 1 [parentNode] => (object value omitted) [childNodes] => (object value omitted) [firstChild] => (object value omitted) [lastChild] => (object value omitted) [previousSibling] => (object value omitted) [nextSibling] => (object value omitted) [attributes] => (object value omitted) [ownerDocument] => (object value omitted) [namespaceURI] => [prefix] => [localName] => td [baseURI] => [textContent] => //<![CDATA[ document.write(BigBlind^BigBlind^60088); //]]> 50088 ) 104.131.248.140 //<![CDATA[ document.write(BigBlind^BigBlind^60088); //]]> 50088 5 79.101.32.14 //<![CDATA[ document.write(Polymorth^Polymorth^1080); //]]> 45080 DOMElement Object ( [schemaTypeInfo] => [tagName] => td [firstElementChild] => [lastElementChild] => [childElementCount] => 0 [previousElementSibling] => (object value omitted) [nextElementSibling] => (object value omitted) [nodeName] => td [nodeValue] => 5 [nodeType] => 1 [parentNode] => (object value omitted) [childNodes] => (object value omitted) [firstChild] => (object value omitted) [lastChild] => (object value omitted) [previousSibling] => (object value omitted) [nextSibling] => (object value omitted) [attributes] => (object value omitted) [ownerDocument] => (object value omitted) [namespaceURI] => [prefix] => [localName] => td [baseURI] => [textContent] => 5 ) 104.131.248.140 //<![CDATA[ document.write(BigBlind^BigBlind^60088); //]]> 50088 5 79.101.32.14 //<![CDATA[ document.write(Polymorth^Polymorth^1080); //]]> 45080 DOMElement Object ( [schemaTypeInfo] => [tagName] => td [firstElementChild] => [lastElementChild] => [childElementCount] => 0 [previousElementSibling] => (object value omitted) [nextElementSibling] => (object value omitted) [nodeName] => td [nodeValue] => 79.101.32.14 [nodeType] => 1 [parentNode] => (object value omitted) [childNodes] => (object value omitted) [firstChild] => (object value omitted) [lastChild] => (object value omitted) [previousSibling] => (object value omitted) [nextSibling] => (object value omitted) [attributes] => (object value omitted) [ownerDocument] => (object value omitted) [namespaceURI] => [prefix] => [localName] => td [baseURI] => [textContent] => 79.101.32.14 ) 104.131.248.140 //<![CDATA[ document.write(BigBlind^BigBlind^60088); //]]> 50088 5 79.101.32.14 //<![CDATA[ document.write(Polymorth^Polymorth^1080); //]]> 45080 DOMElement Object ( [schemaTypeInfo] => [tagName] => td [firstElementChild] => (object value omitted) [lastElementChild] => (object value omitted) [childElementCount] => 1 [previousElementSibling] => (object value omitted) [nextElementSibling] => [nodeName] => td [nodeValue] => //<![CDATA[ document.write(Polymorth^Polymorth^1080); //]]> 45080 [nodeType] => 1 [parentNode] => (object value omitted) [childNodes] => (object value omitted) [firstChild] => (object value omitted) [lastChild] => (object value omitted) [previousSibling] => (object value omitted) [nextSibling] => [attributes] => (object value omitted) [ownerDocument] => (object value omitted) [namespaceURI] => [prefix] => [localName] => td [baseURI] => [textContent] => //<![CDATA[ document.write(Polymorth^Polymorth^1080); //]]> 45080 ) 104.131.248.140 //<![CDATA[ document.write(BigBlind^BigBlind^60088); //]]> 50088 5 79.101.32.14 //<![CDATA[ document.write(Polymorth^Polymorth^1080); //]]> 45080

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:
46.56 ms | 413 KiB | 8 Q