3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<meta name="generator" content="WordPress 4.8.2">'; $dom = new DOMDocument; $dom->loadHTML($html); $heads = $dom->getElementsByTagName('meta'); foreach ($heads as $head) { if($head->getAttribute('name') == 'generator' && preg_match('/wordpress (?<version>(?:\d+\.?)+)/i', $head->getAttribute('content'), $version)) { die($version['version']); } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 31
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 31
Branch analysis from position: 13
2 jumps found. (Code = 46) Position 1 = 18, Position 2 = 27
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 30
Branch analysis from position: 28
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 27
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
filename:       /in/YlsFP
function name:  (null)
number of ops:  33
compiled vars:  !0 = $html, !1 = $dom, !2 = $heads, !3 = $head, !4 = $version
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Cmeta+name%3D%22generator%22+content%3D%22WordPress+4.8.2%22%3E'
    3     1        NEW                                              $6      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $6
    4     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
    5     7        INIT_METHOD_CALL                                         !1, 'getElementsByTagName'
          8        SEND_VAL_EX                                              'meta'
          9        DO_FCALL                                      0  $10     
         10        ASSIGN                                                   !2, $10
    6    11      > FE_RESET_R                                       $12     !2, ->31
         12    > > FE_FETCH_R                                               $12, !3, ->31
    7    13    >   INIT_METHOD_CALL                                         !3, 'getAttribute'
         14        SEND_VAL_EX                                              'name'
         15        DO_FCALL                                      0  $13     
         16        IS_EQUAL                                         ~14     $13, 'generator'
         17      > JMPZ_EX                                          ~14     ~14, ->27
         18    >   INIT_FCALL                                               'preg_match'
         19        SEND_VAL                                                 '%2Fwordpress+%28%3F%3Cversion%3E%28%3F%3A%5Cd%2B%5C.%3F%29%2B%29%2Fi'
         20        INIT_METHOD_CALL                                         !3, 'getAttribute'
         21        SEND_VAL_EX                                              'content'
         22        DO_FCALL                                      0  $15     
         23        SEND_VAR                                                 $15
         24        SEND_REF                                                 !4
         25        DO_ICALL                                         $16     
         26        BOOL                                             ~14     $16
         27    > > JMPZ                                                     ~14, ->30
    8    28    >   FETCH_DIM_R                                      ~17     !4, 'version'
         29      > EXIT                                                     ~17
    6    30    > > JMP                                                      ->12
         31    >   FE_FREE                                                  $12
   10    32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.31 ms | 1001 KiB | 14 Q