3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Config { //declare variables private $kmailtext; function __construct() { $this->kmailtext = "Mail ons"; } public function __get($name) { return $this->$name; } } class someOtherClass extends Config { private $kmailsubject; function __construct() { $this->$kmailsubject = "Subject"; parent::__construct(); } public function someOtherFunction() { return $this->kmailsubject; } public function __get($name) { if (isset($this->$name)) return $this->$name; return parent::__get($name); } } $config = new someOtherClass(); echo $config->someOtherFunction(), PHP_EOL; echo $config->someFunction();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/plNvZ
function name:  (null)
number of ops:  11
compiled vars:  !0 = $config
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   NEW                                              $1      'someOtherClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   41     3        INIT_METHOD_CALL                                         !0, 'someOtherFunction'
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
          6        ECHO                                                     '%0A'
   42     7        INIT_METHOD_CALL                                         !0, 'someFunction'
          8        DO_FCALL                                      0  $5      
          9        ECHO                                                     $5
         10      > RETURN                                                   1

Class Config:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/plNvZ
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN_OBJ                                               'kmailtext'
          1        OP_DATA                                                  'Mail+ons'
   10     2      > RETURN                                                   null

End of function __construct

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

End of function __get

End of class Config.

Class someOtherClass:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/plNvZ
function name:  __construct
number of ops:  5
compiled vars:  !0 = $kmailsubject
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   ASSIGN_OBJ                                               !0
          1        OP_DATA                                                  'Subject'
   24     2        INIT_STATIC_METHOD_CALL                                  
          3        DO_FCALL                                      0          
   25     4      > RETURN                                                   null

End of function __construct

Function someotherfunction:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/plNvZ
function name:  someOtherFunction
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   FETCH_OBJ_R                                      ~0      'kmailsubject'
          1      > RETURN                                                   ~0
   29     2*     > RETURN                                                   null

End of function someotherfunction

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

End of function __get

End of class someOtherClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.71 ms | 1399 KiB | 13 Q