3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html=<<<EOT <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>KvK NL - Uittreksel inzien</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <link rel="stylesheet" type="text/css" href="../css/style.css"/> <link rel="stylesheet" type="text/css" href="../css/uittreksel.css"/> <link rel="stylesheet" type="text/css" href="../css/printUittreksel.css" media="print"/> <script type="text/javascript" src="../resources/nl.kvk.hp.web.pages.InzienPage/google-analytics.js"></script> </head> <body class="hrfixed"> <div> </div> <div id="uittrekselWrapper"> <span><?xml version="1.0" encoding="UTF-8"?> <div id="uittreksel"></div></span> </div> <div id="footer"> </div> </body> </html> EOT; $html = '<?xml version="1.0" encoding="UTF-8"?>' . preg_replace('/(<\?xml[^!\?>]+\?>)/msi','', $html); try { $xml = new DOMDocument('1.0', 'UTF-8'); $xml->loadHTML($html); } catch (DOMException $e) { throw new exception('Document could not be generated, no html found'); } // get the part of the document we need $xpath = new DOMXPath($xml);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 17
Branch analysis from position: 17
2 jumps found. (Code = 107) Position 1 = 18, Position 2 = -2
Branch analysis from position: 18
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/OQSH0
function name:  (null)
number of ops:  27
compiled vars:  !0 = $html, !1 = $xml, !2 = $e, !3 = $xpath
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3C%21DOCTYPE+html+PUBLIC+%22-%2F%2FW3C%2F%2FDTD+XHTML+1.0+Strict%2F%2FEN%22+%22http%3A%2F%2Fwww.w3.org%2FTR%2Fxhtml1%2FDTD%2Fxhtml1-strict.dtd%22%3E%0A%3Chtml+xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%3E%0A++++%3Chead%3E%0A++++++++%3Ctitle%3EKvK+NL+-+Uittreksel+inzien%3C%2Ftitle%3E%0A++++++++%3Cmeta+http-equiv%3D%22Content-Type%22+content%3D%22text%2Fhtml%3B+charset%3DUTF-8%22%2F%3E%0A++++%0A++++++++++++++++%3Clink+rel%3D%22stylesheet%22+type%3D%22text%2Fcss%22+href%3D%22..%2Fcss%2Fstyle.css%22%2F%3E%0A++++++++++++++++%3Clink+rel%3D%22stylesheet%22+type%3D%22text%2Fcss%22+href%3D%22..%2Fcss%2Fuittreksel.css%22%2F%3E%0A++++++++++++++++%3Clink+rel%3D%22stylesheet%22+type%3D%22text%2Fcss%22+href%3D%22..%2Fcss%2FprintUittreksel.css%22+media%3D%22print%22%2F%3E%0A++++++++%3Cscript+type%3D%22text%2Fjavascript%22+src%3D%22..%2Fresources%2Fnl.kvk.hp.web.pages.InzienPage%2Fgoogle-analytics.js%22%3E%3C%2Fscript%3E%0A%3C%2Fhead%3E%0A++++%3Cbody+class%3D%22hrfixed%22%3E%0A++++++++%3Cdiv%3E%0A++%0A%3C%2Fdiv%3E%0A++++++++%0A++++++++++++%0A++++++++++++%3Cdiv+id%3D%22uittrekselWrapper%22%3E%0A%0A++++++++++++++++++++++++%3Cspan%3E%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%0A%3Cdiv+id%3D%22uittreksel%22%3E%3C%2Fdiv%3E%3C%2Fspan%3E++++++++%0A%0A++++++++%3C%2Fdiv%3E%0A++++++++%0A++++++++%0A++++++++%3Cdiv+id%3D%22footer%22%3E%0A++++++++++++++++%0A++++++++%3C%2Fdiv%3E%0A++++%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   36     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%28%3C%5C%3Fxml%5B%5E%21%5C%3F%3E%5D%2B%5C%3F%3E%29%2Fmsi'
          3        SEND_VAL                                                 ''
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $5      
          6        CONCAT                                           ~6      '%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E', $5
          7        ASSIGN                                                   !0, ~6
   40     8        NEW                                              $8      'DOMDocument'
          9        SEND_VAL_EX                                              '1.0'
         10        SEND_VAL_EX                                              'UTF-8'
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !1, $8
   41    13        INIT_METHOD_CALL                                         !1, 'loadHTML'
         14        SEND_VAR_EX                                              !0
         15        DO_FCALL                                      0          
         16      > JMP                                                      ->22
   43    17  E > > CATCH                                       last         'DOMException'
   45    18    >   NEW                                              $12     'exception'
         19        SEND_VAL_EX                                              'Document+could+not+be+generated%2C+no+html+found'
         20        DO_FCALL                                      0          
         21      > THROW                                         0          $12
   49    22    >   NEW                                              $14     'DOMXPath'
         23        SEND_VAR_EX                                              !1
         24        DO_FCALL                                      0          
         25        ASSIGN                                                   !3, $14
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.38 ms | 1400 KiB | 15 Q