3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<p>àâäçß</p>'; $wrapper = '<html><head><meta charset="utf-8"/></head><body>%s</body></html>'; $dom = new DOMDocument; $dom->loadHTML(sprintf($wrapper, $html)); $result = ''; $childNodes = $dom->getElementsByTagName('body')->item(0)->childNodes; foreach ( $childNodes as $childNode ) { $result .= $dom->saveHTML($childNode); } echo $result;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 28
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 28
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/AATjh
function name:  (null)
number of ops:  31
compiled vars:  !0 = $html, !1 = $wrapper, !2 = $dom, !3 = $result, !4 = $childNodes, !5 = $childNode
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Cp%3E%C3%A0%C3%A2%C3%A4%C3%A7%C3%9F%3C%2Fp%3E'
    5     1        ASSIGN                                                   !1, '%3Chtml%3E%3Chead%3E%3Cmeta+charset%3D%22utf-8%22%2F%3E%3C%2Fhead%3E%3Cbody%3E%25s%3C%2Fbody%3E%3C%2Fhtml%3E'
    7     2        NEW                                              $8      'DOMDocument'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !2, $8
    8     5        INIT_METHOD_CALL                                         !2, 'loadHTML'
          6        INIT_FCALL                                               'sprintf'
          7        SEND_VAR                                                 !1
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $11     
         10        SEND_VAR_NO_REF_EX                                       $11
         11        DO_FCALL                                      0          
   10    12        ASSIGN                                                   !3, ''
   12    13        INIT_METHOD_CALL                                         !2, 'getElementsByTagName'
         14        SEND_VAL_EX                                              'body'
         15        DO_FCALL                                      0  $14     
         16        INIT_METHOD_CALL                                         $14, 'item'
         17        SEND_VAL_EX                                              0
         18        DO_FCALL                                      0  $15     
         19        FETCH_OBJ_R                                      ~16     $15, 'childNodes'
         20        ASSIGN                                                   !4, ~16
   14    21      > FE_RESET_R                                       $18     !4, ->28
         22    > > FE_FETCH_R                                               $18, !5, ->28
   15    23    >   INIT_METHOD_CALL                                         !2, 'saveHTML'
         24        SEND_VAR_EX                                              !5
         25        DO_FCALL                                      0  $19     
         26        ASSIGN_OP                                     8          !3, $19
   14    27      > JMP                                                      ->22
         28    >   FE_FREE                                                  $18
   19    29        ECHO                                                     !3
   20    30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.12 ms | 1396 KiB | 15 Q