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

Output for 7.0.16 - 7.0.31, 7.1.2 - 7.1.3, 7.1.5 - 7.2.11
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 hhvm-3.12.14 - 3.15.4, hhvm-3.19.2, 7.1.4

Process exited with code 137.
Output for 5.3.20 - 5.6.38, 7.0.0 - 7.0.15, 7.1.0 - 7.1.1
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 hhvm-3.10.1 - 3.11.1, hhvm-3.18.4 - 3.18.5, hhvm-3.20.2 - 3.22.0
object(DOMNodeList)#11 (1) { ["length"]=> int(8) } Array ( [0] => DOMElement Object ( [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 [tagName] => table [schemaTypeInfo] => ) [1] => DOMElement Object ( [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 [tagName] => table [schemaTypeInfo] => ) )
Output for hhvm-3.17.3
object(DOMNodeList)#11 (1) { ["length"]=> int(8) } Array ( [0] => DOMElement Object ( [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 [tagName] => table [schemaTypeInfo] => ) [1] => DOMElement Object ( [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 [tagName] => table [schemaTypeInfo] => ) )
Process exited with code 137.