3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(~0); $string = '<span/>'; $dom = new DOMDocument(); $dom->loadHTML($string); $dom->preserveWhiteSpace = false; $elements = $dom->getElementsByTagName('span'); while($span = $elements->item(0)) { $span->parentNode->removeChild($span); } echo $dom->saveHTML();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 17
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 17
Branch analysis from position: 26
Branch analysis from position: 17
filename:       /in/ZS0J0
function name:  (null)
number of ops:  30
compiled vars:  !0 = $string, !1 = $dom, !2 = $elements, !3 = $span
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 -1
          2        DO_ICALL                                                 
    4     3        ASSIGN                                                   !0, '%3Cspan%2F%3E'
    6     4        NEW                                              $6      'DOMDocument'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $6
    7     7        INIT_METHOD_CALL                                         !1, 'loadHTML'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
    8    10        ASSIGN_OBJ                                               !1, 'preserveWhiteSpace'
         11        OP_DATA                                                  <false>
   10    12        INIT_METHOD_CALL                                         !1, 'getElementsByTagName'
         13        SEND_VAL_EX                                              'span'
         14        DO_FCALL                                      0  $11     
         15        ASSIGN                                                   !2, $11
   11    16      > JMP                                                      ->21
   12    17    >   FETCH_OBJ_R                                      ~13     !3, 'parentNode'
         18        INIT_METHOD_CALL                                         ~13, 'removeChild'
         19        SEND_VAR_EX                                              !3
         20        DO_FCALL                                      0          
   11    21    >   INIT_METHOD_CALL                                         !2, 'item'
         22        SEND_VAL_EX                                              0
         23        DO_FCALL                                      0  $15     
         24        ASSIGN                                           ~16     !3, $15
         25      > JMPNZ                                                    ~16, ->17
   15    26    >   INIT_METHOD_CALL                                         !1, 'saveHTML'
         27        DO_FCALL                                      0  $17     
         28        ECHO                                                     $17
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.11 ms | 1396 KiB | 15 Q