3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<'XML' <root attribute="42"></root> XML; $dom = new DOMDocument(); $dom->preserveWhiteSpace = FALSE; $dom->loadXml($xml); $objects = [ $dom, $dom->documentElement, $dom->documentElement->attributes->getNamedItem('attribute'), $dom->createTextNode(''), $dom->createComment(''), $dom->createCDATASection(''), $dom->createProcessingInstruction('pi', ''), $dom->createDocumentFragment(), new DOMXPath($dom) ]; foreach ($objects as $object) { echo get_class($object), ': ', method_exists($object, '__get') ? 'true' : 'false', "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 44, Position 2 = 59
Branch analysis from position: 44
2 jumps found. (Code = 78) Position 1 = 45, Position 2 = 59
Branch analysis from position: 45
2 jumps found. (Code = 43) Position 1 = 53, Position 2 = 55
Branch analysis from position: 53
1 jumps found. (Code = 42) Position 1 = 56
Branch analysis from position: 56
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
Branch analysis from position: 55
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
Branch analysis from position: 59
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 59
filename:       /in/ji6bN
function name:  (null)
number of ops:  61
compiled vars:  !0 = $xml, !1 = $dom, !2 = $objects, !3 = $object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Croot+attribute%3D%2242%22%3E%3C%2Froot%3E'
    7     1        NEW                                              $5      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $5
    8     4        ASSIGN_OBJ                                               !1, 'preserveWhiteSpace'
          5        OP_DATA                                                  <false>
    9     6        INIT_METHOD_CALL                                         !1, 'loadXml'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0          
   12     9        INIT_ARRAY                                       ~10     !1
   13    10        FETCH_OBJ_R                                      ~11     !1, 'documentElement'
         11        ADD_ARRAY_ELEMENT                                ~10     ~11
   14    12        FETCH_OBJ_R                                      ~12     !1, 'documentElement'
         13        FETCH_OBJ_R                                      ~13     ~12, 'attributes'
         14        INIT_METHOD_CALL                                         ~13, 'getNamedItem'
         15        SEND_VAL_EX                                              'attribute'
         16        DO_FCALL                                      0  $14     
         17        ADD_ARRAY_ELEMENT                                ~10     $14
   15    18        INIT_METHOD_CALL                                         !1, 'createTextNode'
         19        SEND_VAL_EX                                              ''
         20        DO_FCALL                                      0  $15     
         21        ADD_ARRAY_ELEMENT                                ~10     $15
   16    22        INIT_METHOD_CALL                                         !1, 'createComment'
         23        SEND_VAL_EX                                              ''
         24        DO_FCALL                                      0  $16     
         25        ADD_ARRAY_ELEMENT                                ~10     $16
   17    26        INIT_METHOD_CALL                                         !1, 'createCDATASection'
         27        SEND_VAL_EX                                              ''
         28        DO_FCALL                                      0  $17     
         29        ADD_ARRAY_ELEMENT                                ~10     $17
   18    30        INIT_METHOD_CALL                                         !1, 'createProcessingInstruction'
         31        SEND_VAL_EX                                              'pi'
         32        SEND_VAL_EX                                              ''
         33        DO_FCALL                                      0  $18     
         34        ADD_ARRAY_ELEMENT                                ~10     $18
   19    35        INIT_METHOD_CALL                                         !1, 'createDocumentFragment'
         36        DO_FCALL                                      0  $19     
         37        ADD_ARRAY_ELEMENT                                ~10     $19
   20    38        NEW                                              $20     'DOMXPath'
         39        SEND_VAR_EX                                              !1
         40        DO_FCALL                                      0          
         41        ADD_ARRAY_ELEMENT                                ~10     $20
   11    42        ASSIGN                                                   !2, ~10
   23    43      > FE_RESET_R                                       $23     !2, ->59
         44    > > FE_FETCH_R                                               $23, !3, ->59
   24    45    >   GET_CLASS                                        ~24     !3
         46        ECHO                                                     ~24
         47        ECHO                                                     '%3A+'
         48        INIT_FCALL                                               'method_exists'
         49        SEND_VAR                                                 !3
         50        SEND_VAL                                                 '__get'
         51        DO_ICALL                                         $25     
         52      > JMPZ                                                     $25, ->55
         53    >   QM_ASSIGN                                        ~26     'true'
         54      > JMP                                                      ->56
         55    >   QM_ASSIGN                                        ~26     'false'
         56    >   ECHO                                                     ~26
         57        ECHO                                                     '%0A'
   23    58      > JMP                                                      ->44
         59    >   FE_FREE                                                  $23
   25    60      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.43 ms | 1400 KiB | 15 Q