3v4l.org

run code in 300+ PHP versions simultaneously
<?php $var = '<!DOCTYPE sgml [ <!ELEMENT sgml ANY> <!ENTITY % author "William Shakespeare"> ]> <sgml>&author;</sgml>'; $dom = new DOMDocument; $dom->resolveExternals = true; $dom->loadXML($var); var_dump($dom->doctype->entities->length);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MVeiR
function name:  (null)
number of ops:  16
compiled vars:  !0 = $var, !1 = $dom
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3C%21DOCTYPE+sgml+%5B%0A++%3C%21ELEMENT+sgml+ANY%3E%0A++%3C%21ENTITY+%25+author++++%22William+Shakespeare%22%3E%0A%5D%3E%0A%3Csgml%3E%26author%3B%3C%2Fsgml%3E'
    9     1        NEW                                              $3      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $3
   10     4        ASSIGN_OBJ                                               !1, 'resolveExternals'
          5        OP_DATA                                                  <true>
   11     6        INIT_METHOD_CALL                                         !1, 'loadXML'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0          
   13     9        INIT_FCALL                                               'var_dump'
         10        FETCH_OBJ_R                                      ~8      !1, 'doctype'
         11        FETCH_OBJ_R                                      ~9      ~8, 'entities'
         12        FETCH_OBJ_R                                      ~10     ~9, 'length'
         13        SEND_VAL                                                 ~10
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
192.99 ms | 1394 KiB | 15 Q