3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = '<table><thead><tr><th>Q</th></tr></thead><tr><td>X</td></tr><tbody><tr><td>Z</td></tr></tbody></table>'; $DOM = new DOMDocument; $DOM->loadHTML($a); $xPath = new DOMXPath($DOM); foreach($DOM->getElementsByTagName('table') as $table){ $head = $xPath->query('//thead/tr', $table); $body = $xPath->query('//tbody/tr', $table); $other = $xPath->query('//not(tbody)/tr', $table); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 32
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 32
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
filename:       /in/6E6TH
function name:  (null)
number of ops:  34
compiled vars:  !0 = $a, !1 = $DOM, !2 = $xPath, !3 = $table, !4 = $head, !5 = $body, !6 = $other
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Ctable%3E%3Cthead%3E%3Ctr%3E%3Cth%3EQ%3C%2Fth%3E%3C%2Ftr%3E%3C%2Fthead%3E%3Ctr%3E%3Ctd%3EX%3C%2Ftd%3E%3C%2Ftr%3E%3Ctbody%3E%3Ctr%3E%3Ctd%3EZ%3C%2Ftd%3E%3C%2Ftr%3E%3C%2Ftbody%3E%3C%2Ftable%3E'
    4     1        NEW                                              $8      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $8
    5     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
    6     7        NEW                                              $12     'DOMXPath'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $12
    8    11        INIT_METHOD_CALL                                         !1, 'getElementsByTagName'
         12        SEND_VAL_EX                                              'table'
         13        DO_FCALL                                      0  $15     
         14      > FE_RESET_R                                       $16     $15, ->32
         15    > > FE_FETCH_R                                               $16, !3, ->32
    9    16    >   INIT_METHOD_CALL                                         !2, 'query'
         17        SEND_VAL_EX                                              '%2F%2Fthead%2Ftr'
         18        SEND_VAR_EX                                              !3
         19        DO_FCALL                                      0  $17     
         20        ASSIGN                                                   !4, $17
   10    21        INIT_METHOD_CALL                                         !2, 'query'
         22        SEND_VAL_EX                                              '%2F%2Ftbody%2Ftr'
         23        SEND_VAR_EX                                              !3
         24        DO_FCALL                                      0  $19     
         25        ASSIGN                                                   !5, $19
   11    26        INIT_METHOD_CALL                                         !2, 'query'
         27        SEND_VAL_EX                                              '%2F%2Fnot%28tbody%29%2Ftr'
         28        SEND_VAR_EX                                              !3
         29        DO_FCALL                                      0  $21     
         30        ASSIGN                                                   !6, $21
    8    31      > JMP                                                      ->15
         32    >   FE_FREE                                                  $16
   12    33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.57 ms | 1395 KiB | 13 Q