3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyElement extends \DOMElement { public function __get($name) { return $this->$name; } } $dom = new DOMDocument(); $dom->registerNodeClass('DOMElement', 'MyElement'); $dom->appendChild($dom->createElement('Foo')); $dom->documentElement->appendChild($dom->createElement('Foo', 'Bar')); echo $dom->documentElement->firstChild->nodeValue;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M3c2N
function name:  (null)
number of ops:  26
compiled vars:  !0 = $dom
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $1      'DOMDocument'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    8     3        INIT_METHOD_CALL                                         !0, 'registerNodeClass'
          4        SEND_VAL_EX                                              'DOMElement'
          5        SEND_VAL_EX                                              'MyElement'
          6        DO_FCALL                                      0          
    9     7        INIT_METHOD_CALL                                         !0, 'appendChild'
          8        INIT_METHOD_CALL                                         !0, 'createElement'
          9        SEND_VAL_EX                                              'Foo'
         10        DO_FCALL                                      0  $5      
         11        SEND_VAR_NO_REF_EX                                       $5
         12        DO_FCALL                                      0          
   10    13        FETCH_OBJ_R                                      ~7      !0, 'documentElement'
         14        INIT_METHOD_CALL                                         ~7, 'appendChild'
         15        INIT_METHOD_CALL                                         !0, 'createElement'
         16        SEND_VAL_EX                                              'Foo'
         17        SEND_VAL_EX                                              'Bar'
         18        DO_FCALL                                      0  $8      
         19        SEND_VAR_NO_REF_EX                                       $8
         20        DO_FCALL                                      0          
   12    21        FETCH_OBJ_R                                      ~10     !0, 'documentElement'
         22        FETCH_OBJ_R                                      ~11     ~10, 'firstChild'
         23        FETCH_OBJ_R                                      ~12     ~11, 'nodeValue'
         24        ECHO                                                     ~12
         25      > RETURN                                                   1

Class MyElement:
Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M3c2N
function name:  __get
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        FETCH_OBJ_R                                      ~1      !0
          2      > RETURN                                                   ~1
    5     3*     > RETURN                                                   null

End of function __get

End of class MyElement.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.68 ms | 1395 KiB | 13 Q