3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $a; function __construct($a) { $this->a = $a; } public function getA() { return $this->a; } } class B extends A { function __construct() { parent::__construct('foo'); } } var_dump($b = new B); class C extends A { function __construct(A $a) { $a->a = 'bar'; } } new C($b); var_dump($b); var_dump($b->getA());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sbLSK
function name:  (null)
number of ops:  19
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_FCALL                                               'var_dump'
          1        NEW                                              $1      'B'
          2        DO_FCALL                                      0          
          3        ASSIGN                                           ~3      !0, $1
          4        SEND_VAL                                                 ~3
          5        DO_ICALL                                                 
   29     6        NEW                                              $5      'C'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0          
          9        FREE                                                     $5
   30    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                                 
   31    13        INIT_FCALL                                               'var_dump'
         14        INIT_METHOD_CALL                                         !0, 'getA'
         15        DO_FCALL                                      0  $8      
         16        SEND_VAR                                                 $8
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sbLSK
function name:  __construct
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        ASSIGN_OBJ                                               'a'
          2        OP_DATA                                                  !0
    8     3      > RETURN                                                   null

End of function __construct

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

End of function geta

End of class A.

Class B:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sbLSK
function name:  __construct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_STATIC_METHOD_CALL                                  
          1        SEND_VAL_EX                                              'foo'
          2        DO_FCALL                                      0          
   18     3      > RETURN                                                   null

End of function __construct

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

End of function geta

End of class B.

Class C:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sbLSK
function name:  __construct
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV                                             !0      
   25     1        ASSIGN_OBJ                                               !0, 'a'
          2        OP_DATA                                                  'bar'
   26     3      > RETURN                                                   null

End of function __construct

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

End of function geta

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
219.33 ms | 1400 KiB | 15 Q