3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<h2>Bar</h2><p>lorem ipsum</p>'; $dom = new \DomDocument(); $dom->loadHTML( $html, LIBXML_HTML_NODEFDTD ); $html = ''; foreach( $dom->getElementsByTagName('body')[0]->childNodes as $node ) { $html .= $dom->saveHTML( $node ); } var_dump( $html );
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/ZILf1
function name:  (null)
number of ops:  26
compiled vars:  !0 = $html, !1 = $dom, !2 = $node
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Ch2%3EBar%3C%2Fh2%3E%3Cp%3Elorem+ipsum%3C%2Fp%3E'
    4     1        NEW                                              $4      'DomDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $4
    5     4        INIT_METHOD_CALL                                         !1, 'loadHTML'
          5        SEND_VAR_EX                                              !0
          6        SEND_VAL_EX                                              4
          7        DO_FCALL                                      0          
    6     8        ASSIGN                                                   !0, ''
    7     9        INIT_METHOD_CALL                                         !1, 'getElementsByTagName'
         10        SEND_VAL_EX                                              'body'
         11        DO_FCALL                                      0  $9      
         12        FETCH_DIM_R                                      ~10     $9, 0
         13        FETCH_OBJ_R                                      ~11     ~10, 'childNodes'
         14      > FE_RESET_R                                       $12     ~11, ->21
         15    > > FE_FETCH_R                                               $12, !2, ->21
    8    16    >   INIT_METHOD_CALL                                         !1, 'saveHTML'
         17        SEND_VAR_EX                                              !2
         18        DO_FCALL                                      0  $13     
         19        ASSIGN_OP                                     8          !0, $13
    7    20      > JMP                                                      ->15
         21    >   FE_FREE                                                  $12
   10    22        INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.86 ms | 1395 KiB | 15 Q