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

Finding entry points
Branch analysis from position: 0
Jump found. (Code = 77) Position 1 = 24, Position 2 = 31
Branch analysis from position: 24
Jump found. (Code = 78) Position 1 = 25, Position 2 = 31
Branch analysis from position: 25
Jump found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 31
Jump found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
filename:       /in/Hhk2l
function name:  (null)
number of ops:  41
compiled vars:  !0 = $html, !1 = $doc, !2 = $xpath, !3 = $tds, !4 = $td, !5 = $key, !6 = $ee
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   ASSIGN                                                   !0, '%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E'
   5     1        ASSIGN_CONCAT                                 0          !0, '%3Ctable+class%3D%22grilla%22%3E%3Ctbody%3E%3Ctr+class%3D%22textEncabezadoGrilla%22+bgcolor%3D%22%23C0DAF1%22+align%3D%22center%22%3E%0A%09%09%09%09%09++++++++++%3Cth%3EJuzgado+Polic%C3%ADa+Local%3C%2Fth%3E%0A%09%09%09%09%09++++++++++%3Cth%3ERol+Causa%3C%2Fth%3E%0A%09%09%09%09%09++++++++%3C%2Ftr%3E%0A%0A%09%09%09%09++++++++%09%0A%09%09%09%09++++++++%09%0A%09%09%09%09%09%09++++++++%3Ctr%3E%0A%09%09%09%09%09%09++++++++++%3Ctd+class%3D%22textgrid2%22%3E2+JPL+PROVIDENCIA%3C%2Ftd%3E%0A%09%09%09%09%09%09++++++++++%3Ctd+class%3D%22textgrid2%22%3E018092+-+2010%3C%2Ftd%3E%0A%09%09%09%09%09%09++++++++%3C%2Ftr%3E%0A%09%09%09%09%09%09++++++++%0A%09%09%09++++++++++%09%09%0A%09%09%09%09%09%09++++++++%3Ctr%3E%0A%09%09%09%09%09%09++++++++++%3Ctd+class%3D%22textgrid1%22%3EOVALLE+JPL%3C%2Ftd%3E%0A%09%09%09%09%09%09++++++++++%3Ctd+class%3D%22textgrid1%22%3E13115+-+2010%3C%2Ftd%3E%0A%09%09%09%09%09%09++++++++%3C%2Ftr%3E%0A%09%09%09%09%09%09++++++++%0A%09%09%09++++++++++%09%09%0A%09%09%09++++++++%3C%2Ftbody%3E%3C%2Ftable%3E%0A%09%09%09++++++++%3Ctable+class%3D%22grilla%22%3E%3Ctbody%3E%3Ctr+class%3D%22textEncabezadoGrilla%22+bgcolor%3D%22%23C0DAF1%22+align%3D%22center%22%3E%0A%09%09%09%09%09++++++++++%3Cth%3EJuzgado+Polic%C3%ADa+Local%3C%2Fth%3E%0A%09%09%09%09%09++++++++++%3Cth%3ERol+Causa%3C%2Fth%3E%0A%09%09%09%09%09++++++++%3C%2Ftr%3E%0A%0A%09%09%09%09++++++++%09%0A%09%09%09%09++++++++%09%0A%09%09%09%09%09%09++++++++%3Ctr%3E%0A%09%09%09%09%09%09++++++++++%3Ctd+class%3D%22textgrid2%22%3E2+JPL+PROVIDENCIA%3C%2Ftd%3E%0A%09%09%09%09%09%09++++++++++%3Ctd+class%3D%22textgrid2%22%3E018092+-+2010%3C%2Ftd%3E%0A%09%09%09%09%09%09++++++++%3C%2Ftr%3E%0A%09%09%09%09%09%09++++++++%0A%09%09%09++++++++++%09%09%0A%09%09%09%09%09%09++++++++%3Ctr%3E%0A%09%09%09%09%09%09++++++++++%3Ctd+class%3D%22textgrid1%22%3EOVALLE+JPL%3C%2Ftd%3E%0A%09%09%09%09%09%09++++++++++%3Ctd+class%3D%22textgrid1%22%3E13116+-+2011%3C%2Ftd%3E%0A%09%09%09%09%09%09++++++++%3C%2Ftr%3E%0A%09%09%09%09%09%09++++++++%0A%09%09%09++++++++++%09%09%0A%09%09%09++++++++%3C%2Ftbody%3E%3C%2Ftable%3E'
  45     2        ASSIGN_CONCAT                                 0          !0, '%3C%2Fbody%3E%3C%2Fhtml%3E'
  46     3        NEW                                              $10     :-2
         4        DO_FCALL                                      0          
         5        ASSIGN                                                   !1, $10
  47     6        INIT_METHOD_CALL                                         !1, 'loadHTML'
         7        SEND_VAR_EX                                              !0
         8        DO_FCALL                                      0          
  48     9        NEW                                              $14     :2
        10        SEND_VAR_EX                                              !1
        11        DO_FCALL                                      0          
        12        ASSIGN                                                   !2, $14
  49    13        ASSIGN                                                   !3, <array>
  50    14        INIT_FCALL                                               'var_dump'
        15        INIT_METHOD_CALL                                         !2, 'query'
        16        SEND_VAL_EX                                              '%2F%2Ftable%5B%40class%3D%22grilla%22%5D%2Ftbody%2Ftr%2Ftd%2Ftext%28%29'
        17        DO_FCALL                                      0  $18     
        18        SEND_VAR                                                 $18
        19        DO_ICALL                                                 
  51    20        INIT_METHOD_CALL                                         !2, 'query'
        21        SEND_VAL_EX                                              '%2F%2Ftable%5B%40class%3D%22grilla%22%5D'
        22        DO_FCALL                                      0  $20     
        23      > FE_RESET_R                                       $21     $20, ->31
        24    > > FE_FETCH_R                                       ~22     $21, !4, ->31
        25    >   ASSIGN                                                   !5, ~22
  53    26        INIT_FCALL                                               'array_push'
        27        SEND_REF                                                 !3
        28        SEND_VAR                                                 !4
        29        DO_ICALL                                                 
        30      > JMP                                                      ->24
        31    >   FE_FREE                                                  $21
  55    32        INIT_FCALL                                               'print_r'
        33        SEND_VAR                                                 !3
        34        DO_ICALL                                                 
  56    35        INIT_FCALL                                               'array_chunk'
        36        SEND_VAR                                                 !3
        37        SEND_VAL                                                 2
        38        DO_ICALL                                         $26     
        39        ASSIGN                                                   !6, $26
        40      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.3.0