3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html=<<<HTML <html> <head></head> <body> <table><tr><td>123</td><td>123</td><td>123</td><td>123</td><td>123</td></tr> <tr><td class="group">777</td><td>123</td><td>123</td><td>123</td><td class="mk">888</td></tr> </table> </body> </html> HTML; $dom=new DOMDocument("1.0","UTF-8"); $dom->loadHTML($html); $xpath=new DOMXPath($dom); foreach($xpath->query('//td[@class="group" or @class="mk"]') as $node) { echo $node->textContent; echo "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 22
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 22
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/NYTHe
function name:  (null)
number of ops:  24
compiled vars:  !0 = $html, !1 = $dom, !2 = $xpath, !3 = $node
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Chtml%3E%0A%3Chead%3E%3C%2Fhead%3E%0A%3Cbody%3E%0A%3Ctable%3E%3Ctr%3E%3Ctd%3E123%3C%2Ftd%3E%3Ctd%3E123%3C%2Ftd%3E%3Ctd%3E123%3C%2Ftd%3E%3Ctd%3E123%3C%2Ftd%3E%3Ctd%3E123%3C%2Ftd%3E%3C%2Ftr%3E%0A%3Ctr%3E%3Ctd+class%3D%22group%22%3E777%3C%2Ftd%3E%3Ctd%3E123%3C%2Ftd%3E%3Ctd%3E123%3C%2Ftd%3E%3Ctd%3E123%3C%2Ftd%3E%3Ctd+class%3D%22mk%22%3E888%3C%2Ftd%3E%3C%2Ftr%3E%0A%3C%2Ftable%3E%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   12     1        NEW                                              $5      'DOMDocument'
          2        SEND_VAL_EX                                              '1.0'
          3        SEND_VAL_EX                                              'UTF-8'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   13     6        INIT_METHOD_CALL                                         !1, 'loadHTML'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0          
   14     9        NEW                                              $9      'DOMXPath'
         10        SEND_VAR_EX                                              !1
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !2, $9
   15    13        INIT_METHOD_CALL                                         !2, 'query'
         14        SEND_VAL_EX                                              '%2F%2Ftd%5B%40class%3D%22group%22+or+%40class%3D%22mk%22%5D'
         15        DO_FCALL                                      0  $12     
         16      > FE_RESET_R                                       $13     $12, ->22
         17    > > FE_FETCH_R                                               $13, !3, ->22
   17    18    >   FETCH_OBJ_R                                      ~14     !3, 'textContent'
         19        ECHO                                                     ~14
   18    20        ECHO                                                     '%0A'
   15    21      > JMP                                                      ->17
         22    >   FE_FREE                                                  $13
   19    23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.79 ms | 1395 KiB | 13 Q