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(){ parent::__construct(); $this->var_3 = "Some Text..."; } } $foo = new SecondClass(); echo($foo->var_2->var); var_dump($foo); $doo = new TheClass(); echo $doo->$var_3; 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/dUAeP
function name:  (null)
number of ops:  21
compiled vars:  !0 = $foo, !1 = $doo, !2 = $var_3
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $3      'SecondClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   25     3        FETCH_OBJ_R                                      ~6      !0, 'var_2'
          4        FETCH_OBJ_R                                      ~7      ~6, 'var'
          5        ECHO                                                     ~7
   26     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
   28     9        NEW                                              $9      'TheClass'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !1, $9
   29    12        FETCH_OBJ_R                                      ~12     !1, !2
         13        ECHO                                                     ~12
   30    14        FETCH_OBJ_R                                      ~13     !1, 'var_2'
         15        FETCH_OBJ_R                                      ~14     ~13, 'var'
         16        ECHO                                                     ~14
   31    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Class MainClass:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dUAeP
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/dUAeP
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/dUAeP
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_STATIC_METHOD_CALL                                  
          1        DO_FCALL                                      0          
   20     2        ASSIGN_OBJ                                               'var_3'
          3        OP_DATA                                                  'Some+Text...'
   21     4      > RETURN                                                   null

End of function __construct

End of class TheClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.71 ms | 1400 KiB | 15 Q