3v4l.org

run code in 500+ PHP versions simultaneously
<?php $html=<<<END <font size="3" color="blue">target</font> <font size="3" color="gree">false</font> END; $doc = new DOMDocument(); $doc->loadHTML($html); $xpath = new DOMXPath($doc); $fonts = $xpath->query('//font[@size="3" ][ @color="blue"]'); foreach($fonts as $font){ echo $font->textContent. "\n"; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 21
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 21
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/qSCaq
function name:  (null)
number of ops:  23
compiled vars:  !0 = $html, !1 = $doc, !2 = $xpath, !3 = $fonts, !4 = $font
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, '%3Cfont+size%3D%223%22+color%3D%22blue%22%3Etarget%3C%2Ffont%3E%0A%3Cfont+size%3D%223%22+color%3D%22gree%22%3Efalse%3C%2Ffont%3E'
    6     1        NEW                                                  $6      'DOMDocument'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !1, $6
    7     4        INIT_METHOD_CALL                                             !1, 'loadHTML'
          5        SEND_VAR_EX                                                  !0
          6        DO_FCALL                                          0          
    8     7        NEW                                                  $10     'DOMXPath'
          8        SEND_VAR_EX                                                  !1
          9        DO_FCALL                                          0          
         10        ASSIGN                                                       !2, $10
    9    11        INIT_METHOD_CALL                                             !2, 'query'
         12        SEND_VAL_EX                                                  '%2F%2Ffont%5B%40size%3D%223%22+%5D%5B+%40color%3D%22blue%22%5D'
         13        DO_FCALL                                          0  $13     
         14        ASSIGN                                                       !3, $13
   10    15      > FE_RESET_R                                           $15     !3, ->21
         16    > > FE_FETCH_R                                                   $15, !4, ->21
   11    17    >   FETCH_OBJ_R                                          ~16     !4, 'textContent'
         18        CONCAT                                               ~17     ~16, '%0A'
         19        ECHO                                                         ~17
   10    20      > JMP                                                          ->16
         21    >   FE_FREE                                                      $15
   13    22      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
203.63 ms | 3264 KiB | 12 Q