3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<meta name="generator" content="WordPress 5.9.3"> <meta name="generator" content="Site Kit by Google 1.73.0"> '; $doc = new DOMDocument(); $doc->loadHTML($html); $metas = $doc->getElementsByTagName('meta'); foreach($metas as $meta){ if($meta->getAttribute('name') == 'generator'){ echo $meta->getAttribute('content') . PHP_EOL; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 24
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 24
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 23
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 23
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/jDeNo
function name:  (null)
number of ops:  26
compiled vars:  !0 = $html, !1 = $doc, !2 = $metas, !3 = $meta
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Cmeta+name%3D%22generator%22+content%3D%22WordPress+5.9.3%22%3E%0A%3Cmeta+name%3D%22generator%22+content%3D%22Site+Kit+by+Google+1.73.0%22%3E%0A'
    5     1        NEW                                              $5      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $5
    6     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
    7     7        INIT_METHOD_CALL                                         !1, 'getElementsByTagName'
          8        SEND_VAL_EX                                              'meta'
          9        DO_FCALL                                      0  $9      
         10        ASSIGN                                                   !2, $9
    8    11      > FE_RESET_R                                       $11     !2, ->24
         12    > > FE_FETCH_R                                               $11, !3, ->24
    9    13    >   INIT_METHOD_CALL                                         !3, 'getAttribute'
         14        SEND_VAL_EX                                              'name'
         15        DO_FCALL                                      0  $12     
         16        IS_EQUAL                                                 $12, 'generator'
         17      > JMPZ                                                     ~13, ->23
   10    18    >   INIT_METHOD_CALL                                         !3, 'getAttribute'
         19        SEND_VAL_EX                                              'content'
         20        DO_FCALL                                      0  $14     
         21        CONCAT                                           ~15     $14, '%0A'
         22        ECHO                                                     ~15
    8    23    > > JMP                                                      ->12
         24    >   FE_FREE                                                  $11
   12    25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.92 ms | 1395 KiB | 13 Q