3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<html><body><div id="fred" class="item active" style="display: block; left: 685.5753504672897px; top: 0px; height: 475.3125px; width: 318.84929906542055px; font-size: 100%; z-index: 32768; visibility: visible;"></div></body></html>'; $doc = new DOMDocument(); $doc->loadHTML($html); $xpath = new DOMXPath($doc); $resulted = $xpath->query('*/div[@class="active"]'); var_dump($resulted); foreach ($resulted as $result) { var_dump($result); $active = $result->query('div[@class="content"]'); var_dump($active); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 31
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 31
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
filename:       /in/dXNms
function name:  (null)
number of ops:  33
compiled vars:  !0 = $html, !1 = $doc, !2 = $xpath, !3 = $resulted, !4 = $result, !5 = $active
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Chtml%3E%3Cbody%3E%3Cdiv+id%3D%22fred%22+class%3D%22item+active%22+style%3D%22display%3A+block%3B+left%3A+685.5753504672897px%3B+top%3A+0px%3B+height%3A+475.3125px%3B+width%3A+318.84929906542055px%3B+font-size%3A+100%25%3B+z-index%3A+32768%3B+visibility%3A+visible%3B%22%3E%3C%2Fdiv%3E%3C%2Fbody%3E%3C%2Fhtml%3E'
    5     1        NEW                                              $7      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $7
    6     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
    7     7        NEW                                              $11     'DOMXPath'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $11
    8    11        INIT_METHOD_CALL                                         !2, 'query'
         12        SEND_VAL_EX                                              '%2A%2Fdiv%5B%40class%3D%22active%22%5D'
         13        DO_FCALL                                      0  $14     
         14        ASSIGN                                                   !3, $14
    9    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !3
         17        DO_ICALL                                                 
   10    18      > FE_RESET_R                                       $17     !3, ->31
         19    > > FE_FETCH_R                                               $17, !4, ->31
   11    20    >   INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !4
         22        DO_ICALL                                                 
   12    23        INIT_METHOD_CALL                                         !4, 'query'
         24        SEND_VAL_EX                                              'div%5B%40class%3D%22content%22%5D'
         25        DO_FCALL                                      0  $19     
         26        ASSIGN                                                   !5, $19
   13    27        INIT_FCALL                                               'var_dump'
         28        SEND_VAR                                                 !5
         29        DO_ICALL                                                 
   10    30      > JMP                                                      ->19
         31    >   FE_FREE                                                  $17
   14    32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.76 ms | 1388 KiB | 15 Q