3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php /* Just compose the HTML sample */ $html='<html><head></head><body>'; $html.='<table class="grilla"><tbody><tr class="textEncabezadoGrilla" bgcolor="#C0DAF1" align="center"> <th>Juzgado Policía Local</th> <th>Rol Causa</th> </tr> <tr> <td class="textgrid2">2 JPL PROVIDENCIA</td> <td class="textgrid2">018092 - 2010</td> </tr> <tr> <td class="textgrid1">OVALLE JPL</td> <td class="textgrid1">13115 - 2010</td> </tr> </tbody></table> <table class="grilla"><tbody><tr class="textEncabezadoGrilla" bgcolor="#C0DAF1" align="center"> <th>Juzgado Policía Local</th> <th>Rol Causa</th> </tr> <tr> <td class="textgrid2">2 JPL PROVIDENCIA</td> <td class="textgrid2">018092 - 2010</td> </tr> <tr> <td class="textgrid1">OVALLE JPL</td> <td class="textgrid1">13116 - 2011</td> </tr> </tbody></table>'; $html.="</body></html>"; $doc=new DOMDocument(); $doc->loadHTML($html); $xpath=new DOMXPath($doc); $tds = array(); var_dump($xpath->query('//table[@class="grilla"]/tbody/tr/td/text()')); foreach($xpath->query('//table[@class="grilla"]') as $key => $td) { array_push($tds, $td); } print_r($tds); $ee = array_chunk($tds, 2);
based on 1hrJu

Abusive script

This script was stopped while abusing our resources

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for Typed properties v2
object(DOMNodeList)#11 (1) { ["length"]=> int(8) } Array ( [0] => DOMElement Object ( [tagName] => table [schemaTypeInfo] => [nodeName] => table [nodeValue] => Juzgado Policía Local Rol Causa 2 JPL PROVIDENCIA 018092 - 2010 OVALLE JPL 13115 - 2010 [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] => table [baseURI] => [textContent] => Juzgado Policía Local Rol Causa 2 JPL PROVIDENCIA 018092 - 2010 OVALLE JPL 13115 - 2010 ) [1] => DOMElement Object ( [tagName] => table [schemaTypeInfo] => [nodeName] => table [nodeValue] => Juzgado Policía Local Rol Causa 2 JPL PROVIDENCIA 018092 - 2010 OVALLE JPL 13116 - 2011 [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] => table [baseURI] => [textContent] => Juzgado Policía Local Rol Causa 2 JPL PROVIDENCIA 018092 - 2010 OVALLE JPL 13116 - 2011 ) )
Output for Arrow functions
object(DOMNodeList)#11 (1) { ["length"]=> int(8) } Array ( [0] => DOMElement Object ( [tagName] => table [schemaTypeInfo] => [nodeName] => table [nodeValue] => Juzgado Policía Local Rol Causa 2 JPL PROVIDENCIA 018092 - 2010 OVALLE JPL 13115 - 2010 [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] => table [baseURI] => [textContent] => Juzgado Policía Local Rol Causa 2 JPL PROVIDENCIA 018092 - 2010 OVALLE JPL 13115 - 2010 ) [1] => DOMElement Object ( [tagName] => table [schemaTypeInfo] => [nodeName] => table [nodeValue] => Juzgado Policía Local Rol Causa 2 JPL PROVIDENCIA 018092 - 2010 OVALLE JPL 13116 - 2011 [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] => table [baseURI] => [textContent] => Juzgado Policía Local Rol Causa 2 JPL PROVIDENCIA 018092 - 2010 OVALLE JPL 13116 - 2011 ) )
Output for Object typehint
object(DOMNodeList)#11 (1) { ["length"]=> int(8) } Array ( [0] => DOMElement Object ( [tagName] => table [schemaTypeInfo] => [nodeName] => table [nodeValue] => Juzgado Policía Local Rol Causa 2 JPL PROVIDENCIA 018092 - 2010 OVALLE JPL 13115 - 2010 [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] => table [baseURI] => [textContent] => Juzgado Policía Local Rol Causa 2 JPL PROVIDENCIA 018092 - 2010 OVALLE JPL 13115 - 2010 ) [1] => DOMElement Object ( [tagName] => table [schemaTypeInfo] => [nodeName] => table [nodeValue] => Juzgado Policía Local Rol Causa 2 JPL PROVIDENCIA 018092 - 2010 OVALLE JPL 13116 - 2011 [nodeType] => 1 [parentNode] => (object value omitted) [childNodes] => (object value omitted) [firstChild] => (object value omitted) [lastChild] => (object value omitted) [previousSibling] => (object value omitted) [attributes] => (object value omitted) [ownerDocument] => (object value omitted) [namespaceURI] => [prefix] => [localName] => table [baseURI] => [textContent] => Juzgado Policía Local Rol Causa 2 JPL PROVIDENCIA 018092 - 2010 OVALLE JPL 13116 - 2011 ) )
Output for Array change keys
object(DOMNodeList)#11 (1) { ["length"]=> int(8) } Array ( [0] => DOMElement Object ( [tagName] => table [schemaTypeInfo] => [nodeName] => table [nodeValue] => Juzgado Policía Local Rol Causa 2 JPL PROVIDENCIA 018092 - 2010 OVALLE JPL 13115 - 2010 [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] => table [baseURI] => [textContent] => Juzgado Policía Local Rol Causa 2 JPL PROVIDENCIA 018092 - 2010 OVALLE JPL 13115 - 2010 ) [1] => DOMElement Object ( [tagName] => table [schemaTypeInfo] => [nodeName] => table [nodeValue] => Juzgado Policía Local Rol Causa 2 JPL PROVIDENCIA 018092 - 2010 OVALLE JPL 13116 - 2011 [nodeType] => 1 [parentNode] => (object value omitted) [childNodes] => (object value omitted) [firstChild] => (object value omitted) [lastChild] => (object value omitted) [previousSibling] => (object value omitted) [attributes] => (object value omitted) [ownerDocument] => (object value omitted) [namespaceURI] => [prefix] => [localName] => table [baseURI] => [textContent] => Juzgado Policía Local Rol Causa 2 JPL PROVIDENCIA 018092 - 2010 OVALLE JPL 13116 - 2011 ) )
Output for Lexical anon
object(DOMNodeList)#11 (1) { ["length"]=> int(8) } Array ( [0] => DOMElement Object ( [tagName] => table [schemaTypeInfo] => [nodeName] => table [nodeValue] => Juzgado Policía Local Rol Causa 2 JPL PROVIDENCIA 018092 - 2010 OVALLE JPL 13115 - 2010 [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] => table [baseURI] => [textContent] => Juzgado Policía Local Rol Causa 2 JPL PROVIDENCIA 018092 - 2010 OVALLE JPL 13115 - 2010 ) [1] => DOMElement Object ( [tagName] => table [schemaTypeInfo] => [nodeName] => table [nodeValue] => Juzgado Policía Local Rol Causa 2 JPL PROVIDENCIA 018092 - 2010 OVALLE JPL 13116 - 2011 [nodeType] => 1 [parentNode] => (object value omitted) [childNodes] => (object value omitted) [firstChild] => (object value omitted) [lastChild] => (object value omitted) [previousSibling] => (object value omitted) [attributes] => (object value omitted) [ownerDocument] => (object value omitted) [namespaceURI] => [prefix] => [localName] => table [baseURI] => [textContent] => Juzgado Policía Local Rol Causa 2 JPL PROVIDENCIA 018092 - 2010 OVALLE JPL 13116 - 2011 ) )

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