3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <a name="file_type_definition"></a>file_type_definition ::= <font color=#a08000><strong>FILE</strong></font> <font color=#a08000><strong>OF</strong></font> <a href="#type_mark">type_mark</a> HTML; $dom = new DOMDocument(); $dom->loadHTML($html); $xpath = new DOMXPath($dom); foreach($xpath->query('//strong') as $strong) { $strong->parentNode->replaceChild(sprintf("'%s'", $strong->textContent),$strong); } var_dump($dom->textContent);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 27
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 27
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/sO3YP
function name:  (null)
number of ops:  33
compiled vars:  !0 = $html, !1 = $dom, !2 = $xpath, !3 = $strong
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Ca+name%3D%22file_type_definition%22%3E%3C%2Fa%3Efile_type_definition+%3A%3A%3D%0A%09%3Cfont+color%3D%23a08000%3E%3Cstrong%3EFILE%3C%2Fstrong%3E%3C%2Ffont%3E++%3Cfont+color%3D%23a08000%3E%3Cstrong%3EOF%3C%2Fstrong%3E%3C%2Ffont%3E+%3Ca+href%3D%22%23type_mark%22%3Etype_mark%3C%2Fa%3E'
    8     1        NEW                                              $5      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $5
    9     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   10     7        NEW                                              $9      'DOMXPath'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $9
   12    11        INIT_METHOD_CALL                                         !2, 'query'
         12        SEND_VAL_EX                                              '%2F%2Fstrong'
         13        DO_FCALL                                      0  $12     
         14      > FE_RESET_R                                       $13     $12, ->27
         15    > > FE_FETCH_R                                               $13, !3, ->27
   13    16    >   FETCH_OBJ_R                                      ~14     !3, 'parentNode'
         17        INIT_METHOD_CALL                                         ~14, 'replaceChild'
         18        INIT_FCALL                                               'sprintf'
         19        SEND_VAL                                                 '%27%25s%27'
         20        FETCH_OBJ_R                                      ~15     !3, 'textContent'
         21        SEND_VAL                                                 ~15
         22        DO_ICALL                                         $16     
         23        SEND_VAR_NO_REF_EX                                       $16
         24        SEND_VAR_EX                                              !3
         25        DO_FCALL                                      0          
   12    26      > JMP                                                      ->15
         27    >   FE_FREE                                                  $13
   16    28        INIT_FCALL                                               'var_dump'
         29        FETCH_OBJ_R                                      ~18     !1, 'textContent'
         30        SEND_VAL                                                 ~18
         31        DO_ICALL                                                 
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.72 ms | 1012 KiB | 15 Q