3v4l.org

run code in 500+ PHP versions simultaneously
<?php $html = "<span data-img-type='cvr' data-img-att-alt='Cover of Greek Mythology' data-img-size-xs='image.jpg'></span> <h3> Cover of Greek Mythology </h3>"; $scriptDocument = new DOMDocument(); libxml_use_internal_errors(TRUE); if (!empty($html)){ $scriptDocument->loadHTML($html); libxml_clear_errors(); $scriptDOMXPath = new DOMXPath($scriptDocument); //get all the h3's with an class $scriptRow = $scriptDOMXPath->query('//h3'); //check if ($scriptRow->length > 0){ foreach($scriptRow as $row){ echo $row->nodeValue . "<br/>"; } } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 33
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 33
Branch analysis from position: 26
2 jumps found. (Code = 77) Position 1 = 27, Position 2 = 32
Branch analysis from position: 27
2 jumps found. (Code = 78) Position 1 = 28, Position 2 = 32
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
Branch analysis from position: 33
Branch analysis from position: 33
filename:       /in/brmut
function name:  (null)
number of ops:  34
compiled vars:  !0 = $html, !1 = $scriptDocument, !2 = $scriptDOMXPath, !3 = $scriptRow, !4 = $row
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%3Cspan+data-img-type%3D%27cvr%27+data-img-att-alt%3D%27Cover+of+Greek+Mythology%27+data-img-size-xs%3D%27image.jpg%27%3E%3C%2Fspan%3E%0A%3Ch3%3E+Cover+of+Greek+Mythology+%3C%2Fh3%3E'
    6     1        NEW                                                  $6      'DOMDocument'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !1, $6
    7     4        INIT_FCALL                                                   'libxml_use_internal_errors'
          5        SEND_VAL                                                     <true>
          6        DO_ICALL                                                     
    9     7        ISSET_ISEMPTY_CV                                     ~10     !0
          8        BOOL_NOT                                             ~11     ~10
          9      > JMPZ                                                         ~11, ->33
   10    10    >   INIT_METHOD_CALL                                             !1, 'loadHTML'
         11        SEND_VAR_EX                                                  !0
         12        DO_FCALL                                          0          
   11    13        INIT_FCALL                                                   'libxml_clear_errors'
         14        DO_ICALL                                                     
   12    15        NEW                                                  $14     'DOMXPath'
         16        SEND_VAR_EX                                                  !1
         17        DO_FCALL                                          0          
         18        ASSIGN                                                       !2, $14
   14    19        INIT_METHOD_CALL                                             !2, 'query'
         20        SEND_VAL_EX                                                  '%2F%2Fh3'
         21        DO_FCALL                                          0  $17     
         22        ASSIGN                                                       !3, $17
   16    23        FETCH_OBJ_R                                          ~19     !3, 'length'
         24        IS_SMALLER                                                   0, ~19
         25      > JMPZ                                                         ~20, ->33
   17    26    > > FE_RESET_R                                           $21     !3, ->32
         27    > > FE_FETCH_R                                                   $21, !4, ->32
   18    28    >   FETCH_OBJ_R                                          ~22     !4, 'nodeValue'
         29        CONCAT                                               ~23     ~22, '%3Cbr%2F%3E'
         30        ECHO                                                         ~23
   17    31      > JMP                                                          ->27
         32    >   FE_FREE                                                      $21
   21    33    > > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
234.17 ms | 2061 KiB | 15 Q