3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<'HTML' <!DOCTYPE html><html><body> <small>0</small> <small>1</small> <small>2</small> <small>3</small> </body></html> HTML; $dom = new DOMDocument; $dom->loadHTML($html); $nodeArray = iterator_to_array($dom->getElementsByTagName('small')); foreach($nodeArray as $node) { $node->parentNode->removeChild($node); } echo $dom->saveHTML();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 21
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 21
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/tu0SA
function name:  (null)
number of ops:  26
compiled vars:  !0 = $html, !1 = $dom, !2 = $nodeArray, !3 = $node
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3C%21DOCTYPE+html%3E%3Chtml%3E%3Cbody%3E%0A%3Csmall%3E0%3C%2Fsmall%3E%0A%3Csmall%3E1%3C%2Fsmall%3E%0A%3Csmall%3E2%3C%2Fsmall%3E%0A%3Csmall%3E3%3C%2Fsmall%3E%0A%3C%2Fbody%3E%3C%2Fhtml%3E'
   12     1        NEW                                              $5      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $5
   13     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   15     7        INIT_FCALL                                               'iterator_to_array'
          8        INIT_METHOD_CALL                                         !1, 'getElementsByTagName'
          9        SEND_VAL_EX                                              'small'
         10        DO_FCALL                                      0  $9      
         11        SEND_VAR                                                 $9
         12        DO_ICALL                                         $10     
         13        ASSIGN                                                   !2, $10
   17    14      > FE_RESET_R                                       $12     !2, ->21
         15    > > FE_FETCH_R                                               $12, !3, ->21
   18    16    >   FETCH_OBJ_R                                      ~13     !3, 'parentNode'
         17        INIT_METHOD_CALL                                         ~13, 'removeChild'
         18        SEND_VAR_EX                                              !3
         19        DO_FCALL                                      0          
   17    20      > JMP                                                      ->15
         21    >   FE_FREE                                                  $12
   21    22        INIT_METHOD_CALL                                         !1, 'saveHTML'
         23        DO_FCALL                                      0  $15     
         24        ECHO                                                     $15
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
224.68 ms | 1068 KiB | 14 Q