3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<html><body><div>123</div><div>456</div></body></html>'; $dom = new DOMDocument; $dom->preserveWhiteSpace = true; $dom->formatOutput = false; $dom->loadHTML($html, LIBXML_HTML_NODEFDTD); $body = $dom->getElementsByTagName('body')->item(0); echo $dom->saveHTML($body);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fcTVn
function name:  (null)
number of ops:  24
compiled vars:  !0 = $html, !1 = $dom, !2 = $body
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Chtml%3E%3Cbody%3E%3Cdiv%3E123%3C%2Fdiv%3E%3Cdiv%3E456%3C%2Fdiv%3E%3C%2Fbody%3E%3C%2Fhtml%3E'
    3     1        NEW                                              $4      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $4
    4     4        ASSIGN_OBJ                                               !1, 'preserveWhiteSpace'
          5        OP_DATA                                                  <true>
    5     6        ASSIGN_OBJ                                               !1, 'formatOutput'
          7        OP_DATA                                                  <false>
    6     8        INIT_METHOD_CALL                                         !1, 'loadHTML'
          9        SEND_VAR_EX                                              !0
         10        SEND_VAL_EX                                              4
         11        DO_FCALL                                      0          
    7    12        INIT_METHOD_CALL                                         !1, 'getElementsByTagName'
         13        SEND_VAL_EX                                              'body'
         14        DO_FCALL                                      0  $10     
         15        INIT_METHOD_CALL                                         $10, 'item'
         16        SEND_VAL_EX                                              0
         17        DO_FCALL                                      0  $11     
         18        ASSIGN                                                   !2, $11
    8    19        INIT_METHOD_CALL                                         !1, 'saveHTML'
         20        SEND_VAR_EX                                              !2
         21        DO_FCALL                                      0  $13     
         22        ECHO                                                     $13
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.9 ms | 989 KiB | 13 Q