3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.04 ms | 1394 KiB | 13 Q