3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* Just compose the HTML sample */ $html='<html><head></head><body><table id="myTable">'; for($i=0;$i<100;$i++) { $html.="<tr><td>info{$i}.1</td><td>info{$i}.2</td><td>info{$i}.3</td></tr>"; } $html.="</table></body></html>"; $doc=new DOMDocument(); $doc->loadHTML($html); $xpath=new DOMXPath($doc); echo "<table>\n"; $i=0; $tds=array(); foreach($xpath->query('//table[@id="myTable"]/tr/td/text()') as $td) { /* 30 is each row's old-cell-count */ if($i%30==0) echo "<tr>\n"; $tds[]=$td->nodeValue; /* 3 is each cell's old-cell-count */ if($i%3==2) { echo "\t<td>".implode("<br />",$tds)."</td>\n"; $tds=array(); } if($i%30==29) echo "</tr>\n"; $i++; } echo "</table>";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 3
Branch analysis from position: 14
2 jumps found. (Code = 77) Position 1 = 32, Position 2 = 57
Branch analysis from position: 32
2 jumps found. (Code = 78) Position 1 = 33, Position 2 = 57
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 37
Branch analysis from position: 36
2 jumps found. (Code = 43) Position 1 = 43, Position 2 = 51
Branch analysis from position: 43
2 jumps found. (Code = 43) Position 1 = 54, Position 2 = 55
Branch analysis from position: 54
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
Branch analysis from position: 55
Branch analysis from position: 51
Branch analysis from position: 37
Branch analysis from position: 57
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 57
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 3
Branch analysis from position: 14
Branch analysis from position: 3
filename:       /in/BncaL
function name:  (null)
number of ops:  60
compiled vars:  !0 = $html, !1 = $i, !2 = $doc, !3 = $xpath, !4 = $tds, !5 = $td
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3Ctable+id%3D%22myTable%22%3E'
    4     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->12
    6     3    >   ROPE_INIT                                     7  ~9      '%3Ctr%3E%3Ctd%3Einfo'
          4        ROPE_ADD                                      1  ~9      ~9, !1
          5        ROPE_ADD                                      2  ~9      ~9, '.1%3C%2Ftd%3E%3Ctd%3Einfo'
          6        ROPE_ADD                                      3  ~9      ~9, !1
          7        ROPE_ADD                                      4  ~9      ~9, '.2%3C%2Ftd%3E%3Ctd%3Einfo'
          8        ROPE_ADD                                      5  ~9      ~9, !1
          9        ROPE_END                                      6  ~8      ~9, '.3%3C%2Ftd%3E%3C%2Ftr%3E'
         10        ASSIGN_OP                                     8          !0, ~8
    4    11        PRE_INC                                                  !1
         12    >   IS_SMALLER                                               !1, 100
         13      > JMPNZ                                                    ~15, ->3
    8    14    >   ASSIGN_OP                                     8          !0, '%3C%2Ftable%3E%3C%2Fbody%3E%3C%2Fhtml%3E'
    9    15        NEW                                              $17     'DOMDocument'
         16        DO_FCALL                                      0          
         17        ASSIGN                                                   !2, $17
   10    18        INIT_METHOD_CALL                                         !2, 'loadHTML'
         19        SEND_VAR_EX                                              !0
         20        DO_FCALL                                      0          
   11    21        NEW                                              $21     'DOMXPath'
         22        SEND_VAR_EX                                              !2
         23        DO_FCALL                                      0          
         24        ASSIGN                                                   !3, $21
   12    25        ECHO                                                     '%3Ctable%3E%0A'
   13    26        ASSIGN                                                   !1, 0
   14    27        ASSIGN                                                   !4, <array>
   15    28        INIT_METHOD_CALL                                         !3, 'query'
         29        SEND_VAL_EX                                              '%2F%2Ftable%5B%40id%3D%22myTable%22%5D%2Ftr%2Ftd%2Ftext%28%29'
         30        DO_FCALL                                      0  $26     
         31      > FE_RESET_R                                       $27     $26, ->57
         32    > > FE_FETCH_R                                               $27, !5, ->57
   18    33    >   MOD                                              ~28     !1, 30
         34        IS_EQUAL                                                 ~28, 0
         35      > JMPZ                                                     ~29, ->37
         36    >   ECHO                                                     '%3Ctr%3E%0A'
   19    37    >   FETCH_OBJ_R                                      ~31     !5, 'nodeValue'
         38        ASSIGN_DIM                                               !4
         39        OP_DATA                                                  ~31
   21    40        MOD                                              ~32     !1, 3
         41        IS_EQUAL                                                 ~32, 2
         42      > JMPZ                                                     ~33, ->51
   23    43    >   INIT_FCALL                                               'implode'
         44        SEND_VAL                                                 '%3Cbr+%2F%3E'
         45        SEND_VAR                                                 !4
         46        DO_ICALL                                         $34     
         47        CONCAT                                           ~35     '%09%3Ctd%3E', $34
         48        CONCAT                                           ~36     ~35, '%3C%2Ftd%3E%0A'
         49        ECHO                                                     ~36
   24    50        ASSIGN                                                   !4, <array>
   26    51    >   MOD                                              ~38     !1, 30
         52        IS_EQUAL                                                 ~38, 29
         53      > JMPZ                                                     ~39, ->55
         54    >   ECHO                                                     '%3C%2Ftr%3E%0A'
   27    55    >   PRE_INC                                                  !1
   15    56      > JMP                                                      ->32
         57    >   FE_FREE                                                  $27
   29    58        ECHO                                                     '%3C%2Ftable%3E'
         59      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.01 ms | 1400 KiB | 15 Q