3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dom = DOM\HTMLDocument::createFromString('<body><h1>Test</h1></body>', LIBXML_NOERROR); echo $dom->body->innerHTML, "\n"; // Output: <h1>Test</h1> $dom->body->innerHTML = '<p>Something new</p>'; echo $dom->saveHTML(); // Output: <html><head></head><body><p>Something new</p></body></html>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/R7sAl
function name:  (null)
number of ops:  16
compiled vars:  !0 = $dom
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_STATIC_METHOD_CALL                                  'DOM%5CHTMLDocument', 'createFromString'
          1        SEND_VAL_EX                                              '%3Cbody%3E%3Ch1%3ETest%3C%2Fh1%3E%3C%2Fbody%3E'
          2        SEND_VAL_EX                                              32
          3        DO_FCALL                                      0  $1      
          4        ASSIGN                                                   !0, $1
    4     5        FETCH_OBJ_R                                      ~3      !0, 'body'
          6        FETCH_OBJ_R                                      ~4      ~3, 'innerHTML'
          7        ECHO                                                     ~4
          8        ECHO                                                     '%0A'
    6     9        FETCH_OBJ_W                                      $5      !0, 'body'
         10        ASSIGN_OBJ                                               $5, 'innerHTML'
         11        OP_DATA                                                  '%3Cp%3ESomething+new%3C%2Fp%3E'
    7    12        INIT_METHOD_CALL                                         !0, 'saveHTML'
         13        DO_FCALL                                      0  $7      
         14        ECHO                                                     $7
    8    15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
131.86 ms | 1447 KiB | 13 Q