3v4l.org

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

Class MyElement:
Function __get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rLOLC
function name:  __get
number of ops:  10
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        DEFINED                                                  'HHVM_VERSION'
          2      > JMPZ                                                     ~1, ->7
    6     3    >   INIT_STATIC_METHOD_CALL                                  '__get'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0  $2      
          6      > RETURN                                                   $2
    8     7    >   FETCH_OBJ_R                                      ~3      !0
          8      > RETURN                                                   ~3
    9     9*     > RETURN                                                   null

End of function __get

End of class MyElement.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.77 ms | 1395 KiB | 13 Q