3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<?xml version="1.0" encoding="UTF-8"?><html> <head> <title>Waa?</title> </head> <body> <ul> <li><img src="http://i.mg" alt="waa?" /><li /></li> </ul> </body> </html>'; /* $doc = new DOMDocument('1.0', 'UTF-8'); $doc->resolveExternals = true; $doc->loadXML($xml); $doc->validate(); */ $root = 'html'; $systemId = "http://office.react.nl/~arjen/php/xhtml1-transitional.dtd"; $creator = new DOMImplementation; $doctype = $creator->createDocumentType($root, null, $systemId); $new = $creator->createDocument(null, null, $doctype); $new->encoding = "utf-8"; $new->resolveExternals = true; var_dump($new->doctype === $doctype); $new->loadXML($xml); var_dump($new->doctype === $doctype); $new->validate();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hrYHn
function name:  (null)
number of ops:  38
compiled vars:  !0 = $xml, !1 = $root, !2 = $systemId, !3 = $creator, !4 = $doctype, !5 = $new
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%3Chtml%3E%0A%09%3Chead%3E%0A%09%09%3Ctitle%3EWaa%3F%3C%2Ftitle%3E%0A%09%3C%2Fhead%3E%0A%09%3Cbody%3E%0A%09%09%3Cul%3E%0A%09%09%09%3Cli%3E%3Cimg+src%3D%22http%3A%2F%2Fi.mg%22+alt%3D%22waa%3F%22+%2F%3E%3Cli+%2F%3E%3C%2Fli%3E%0A%09%09%3C%2Ful%3E%0A%09%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   20     1        ASSIGN                                                   !1, 'html'
   21     2        ASSIGN                                                   !2, 'http%3A%2F%2Foffice.react.nl%2F%7Earjen%2Fphp%2Fxhtml1-transitional.dtd'
   23     3        NEW                                              $9      'DOMImplementation'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !3, $9
   24     6        INIT_METHOD_CALL                                         !3, 'createDocumentType'
          7        SEND_VAR_EX                                              !1
          8        SEND_VAL_EX                                              null
          9        SEND_VAR_EX                                              !2
         10        DO_FCALL                                      0  $12     
         11        ASSIGN                                                   !4, $12
   25    12        INIT_METHOD_CALL                                         !3, 'createDocument'
         13        SEND_VAL_EX                                              null
         14        SEND_VAL_EX                                              null
         15        SEND_VAR_EX                                              !4
         16        DO_FCALL                                      0  $14     
         17        ASSIGN                                                   !5, $14
   26    18        ASSIGN_OBJ                                               !5, 'encoding'
         19        OP_DATA                                                  'utf-8'
   27    20        ASSIGN_OBJ                                               !5, 'resolveExternals'
         21        OP_DATA                                                  <true>
   28    22        INIT_FCALL                                               'var_dump'
         23        FETCH_OBJ_R                                      ~18     !5, 'doctype'
         24        IS_IDENTICAL                                     ~19     !4, ~18
         25        SEND_VAL                                                 ~19
         26        DO_ICALL                                                 
   29    27        INIT_METHOD_CALL                                         !5, 'loadXML'
         28        SEND_VAR_EX                                              !0
         29        DO_FCALL                                      0          
   30    30        INIT_FCALL                                               'var_dump'
         31        FETCH_OBJ_R                                      ~22     !5, 'doctype'
         32        IS_IDENTICAL                                     ~23     !4, ~22
         33        SEND_VAL                                                 ~23
         34        DO_ICALL                                                 
   31    35        INIT_METHOD_CALL                                         !5, 'validate'
         36        DO_FCALL                                      0          
         37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.28 ms | 1396 KiB | 15 Q