3v4l.org

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

Class MyTextNode:
Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7jITX
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 MyTextNode.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.97 ms | 1396 KiB | 15 Q