3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<EOF <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>test</title> </head> <body> <form> <input type="text" required>test <input type="submit">test </form> <img src="foo.png"> <h1>title</h1> </body> </html> EOF; libxml_use_internal_errors(true); libxml_clear_errors(); $dom = new DOMDocument; $dom->recover = true; $r = $dom->loadHTML($html, LIBXML_NOBLANKS // remove blank nodes | LIBXML_NOCDATA // merge CDATA as text nodes | LIBXML_NONET // disable network access when loading documents | LIBXML_NOWARNING); if(!$r) die('failed to load'); echo $dom->saveHTML();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 19
Branch analysis from position: 18
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1n3gJ
function name:  (null)
number of ops:  23
compiled vars:  !0 = $html, !1 = $dom, !2 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3C%21DOCTYPE+html%3E%0A%3Chtml+lang%3D%22en%22%3E%0A%3Chead%3E%0A%3Cmeta+charset%3D%22utf-8%22%3E%0A%3Ctitle%3Etest%3C%2Ftitle%3E%0A%3C%2Fhead%3E%0A%3Cbody%3E%0A%3Cform%3E%0A%3Cinput+type%3D%22text%22+required%3Etest%0A%3Cinput+type%3D%22submit%22%3Etest%0A%3C%2Fform%3E%0A%3Cimg+src%3D%22foo.png%22%3E%0A%3Ch1%3Etitle%3C%2Fh1%3E%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   21     1        INIT_FCALL                                               'libxml_use_internal_errors'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                                 
   22     4        INIT_FCALL                                               'libxml_clear_errors'
          5        DO_ICALL                                                 
   23     6        NEW                                              $6      'DOMDocument'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $6
   24     9        ASSIGN_OBJ                                               !1, 'recover'
         10        OP_DATA                                                  <true>
   25    11        INIT_METHOD_CALL                                         !1, 'loadHTML'
         12        SEND_VAR_EX                                              !0
   29    13        SEND_VAL_EX                                              18752
         14        DO_FCALL                                      0  $10     
   25    15        ASSIGN                                                   !2, $10
   30    16        BOOL_NOT                                         ~12     !2
         17      > JMPZ                                                     ~12, ->19
         18    > > EXIT                                                     'failed+to+load'
   31    19    >   INIT_METHOD_CALL                                         !1, 'saveHTML'
         20        DO_FCALL                                      0  $13     
         21        ECHO                                                     $13
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.03 ms | 1395 KiB | 17 Q