3v4l.org

run code in 200+ PHP versions simultaneously
<?php $profile = '<!doctype html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <div> <p>イリノイ州シカゴにて、アイルランド系の家庭に、9</p> </div> <div>lol</div> </body> </html> '; $dom = new DOMDocument('1.0', 'UTF-8'); $dom->loadHTML($profile); $collect = ""; foreach($dom->getElementsByTagName('body')->item(0)->childNodes as $childNode){ $collect .= $dom->saveHTML($childNode); } echo $collect;
based on tbgpV
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 24
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 24
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/q3hM6
function name:  (null)
number of ops:  27
compiled vars:  !0 = $profile, !1 = $dom, !2 = $collect, !3 = $childNode
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   QM_ASSIGN                                                !0
  16     1        NEW                                              $5      :48
         2        SEND_VAL_EX                                              '1.0'
         3        SEND_VAL_EX                                              'UTF-8'
         4        DO_FCALL                                      0          
         5        QM_ASSIGN                                                !1
  17     6        INIT_METHOD_CALL                                         !1, 'loadHTML'
         7        SEND_VAR_EX                                              !0
         8        DO_FCALL                                      0          
  18     9        QM_ASSIGN                                                !2
  19    10        INIT_METHOD_CALL                                         !1, 'getElementsByTagName'
        11        SEND_VAL_EX                                              'body'
        12        DO_FCALL                                      0  $10     
        13        INIT_METHOD_CALL                                         $10, 'item'
        14        SEND_VAL_EX                                              0
        15        DO_FCALL                                      0  $11     
        16        FETCH_OBJ_R                                      ~12     $11, 'childNodes'
        17      > FE_RESET_R                                       $13     ~12, ->24
        18    > > FE_FETCH_R                                               $13, !3, ->24
  20    19    >   INIT_METHOD_CALL                                         !1, 'saveHTML'
        20        SEND_VAR_EX                                              !3
        21        DO_FCALL                                      0  $14     
        22        ASSIGN_DIV                                    8          !2, $14
  19    23      > JMP                                                      ->18
        24    >   FE_FREE                                                  $13
  22    25        ASSIGN_OBJ                                               !2
        26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.4.0