3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MainClass{ public $var; function __construct(){ $this->var = "text"; } } class SecondClass{ public $var_2; function __construct(){ $this->var_2 = new MainClass(); } } class TheClass extends SecondClass{ public $var_3; function __construct(){ $this->var_3 = $super->var_2; } } $foo = new SecondClass(); echo($foo->var_2->var); var_dump($foo); $doo = new TheClass(); echo($doo->var_2->var); var_dump($doo);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kmmUt
function name:  (null)
number of ops:  19
compiled vars:  !0 = $foo, !1 = $doo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $2      'SecondClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   26     3        FETCH_OBJ_R                                      ~5      !0, 'var_2'
          4        FETCH_OBJ_R                                      ~6      ~5, 'var'
          5        ECHO                                                     ~6
   27     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
   29     9        NEW                                              $8      'TheClass'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !1, $8
   30    12        FETCH_OBJ_R                                      ~11     !1, 'var_2'
         13        FETCH_OBJ_R                                      ~12     ~11, 'var'
         14        ECHO                                                     ~12
   31    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Class MainClass:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kmmUt
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN_OBJ                                               'var'
          1        OP_DATA                                                  'text'
    6     2      > RETURN                                                   null

End of function __construct

End of class MainClass.

Class SecondClass:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kmmUt
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $1      'MainClass'
          1        DO_FCALL                                      0          
          2        ASSIGN_OBJ                                               'var_2'
          3        OP_DATA                                                  $1
   13     4      > RETURN                                                   null

End of function __construct

End of class SecondClass.

Class TheClass:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kmmUt
function name:  __construct
number of ops:  4
compiled vars:  !0 = $super
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   FETCH_OBJ_R                                      ~2      !0, 'var_2'
          1        ASSIGN_OBJ                                               'var_3'
          2        OP_DATA                                                  ~2
   22     3      > RETURN                                                   null

End of function __construct

End of class TheClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.21 ms | 1400 KiB | 15 Q