3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<EOD <html> <body> <table style="..."> <tbody> <tr> <img id="foo" src="foo"/></tr> </tbody> </table> <p> ....</p> <table style="..."> <tbody> <tr> <img id="bar" src="bar"/></tr> </tbody> </table> </body> </html> EOD; $doc = new DOMDocument(); $doc->loadHTML($html); $xpath = new DOMXPath($doc); $query = '*'; $depth = 1; while ($xpath->query($query)->length) { $depth++; $query .= "/*"; } echo "maximum depth = $depth\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 14
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 14
Branch analysis from position: 21
Branch analysis from position: 14
filename:       /in/TJTYm
function name:  (null)
number of ops:  26
compiled vars:  !0 = $html, !1 = $doc, !2 = $xpath, !3 = $query, !4 = $depth
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Chtml%3E%0A%3Cbody%3E%0A%3Ctable+style%3D%22...%22%3E%0A%3Ctbody%3E%0A%3Ctr%3E+%3Cimg+id%3D%22foo%22+src%3D%22foo%22%2F%3E%3C%2Ftr%3E%0A%3C%2Ftbody%3E%0A%3C%2Ftable%3E%0A%3Cp%3E+....%3C%2Fp%3E%0A%3Ctable+style%3D%22...%22%3E%0A%3Ctbody%3E%0A%3Ctr%3E+%3Cimg+id%3D%22bar%22+src%3D%22bar%22%2F%3E%3C%2Ftr%3E%0A%3C%2Ftbody%3E%0A%3C%2Ftable%3E%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   20     1        NEW                                              $6      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $6
   21     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   22     7        NEW                                              $10     'DOMXPath'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $10
   23    11        ASSIGN                                                   !3, '%2A'
   24    12        ASSIGN                                                   !4, 1
   25    13      > JMP                                                      ->16
   26    14    >   PRE_INC                                                  !4
   27    15        ASSIGN_OP                                     8          !3, '%2F%2A'
   25    16    >   INIT_METHOD_CALL                                         !2, 'query'
         17        SEND_VAR_EX                                              !3
         18        DO_FCALL                                      0  $17     
         19        FETCH_OBJ_R                                      ~18     $17, 'length'
         20      > JMPNZ                                                    ~18, ->14
   29    21    >   ROPE_INIT                                     3  ~20     'maximum+depth+%3D+'
         22        ROPE_ADD                                      1  ~20     ~20, !4
         23        ROPE_END                                      2  ~19     ~20, '%0A'
         24        ECHO                                                     ~19
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
265.17 ms | 1003 KiB | 13 Q