3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function __construct() { } public static function init() { $instance = new static(); $instance->doStuff(); } protected function doStuff() { echo get_class($this); } } class B extends A { } B::init();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Nc91i
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_STATIC_METHOD_CALL                                  'B', 'init'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

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

End of function __construct

Function init:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Nc91i
function name:  init
number of ops:  6
compiled vars:  !0 = $instance
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                          static              $1      
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    9     3        INIT_METHOD_CALL                                         !0, 'doStuff'
          4        DO_FCALL                                      0          
   10     5      > RETURN                                                   null

End of function init

Function dostuff:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Nc91i
function name:  doStuff
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   FETCH_THIS                                       ~0      
          1        GET_CLASS                                        ~1      ~0
          2        ECHO                                                     ~1
   14     3      > RETURN                                                   null

End of function dostuff

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/Nc91i
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   null

End of function __construct

Function init:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Nc91i
function name:  init
number of ops:  6
compiled vars:  !0 = $instance
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                          static              $1      
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    9     3        INIT_METHOD_CALL                                         !0, 'doStuff'
          4        DO_FCALL                                      0          
   10     5      > RETURN                                                   null

End of function init

Function dostuff:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Nc91i
function name:  doStuff
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   FETCH_THIS                                       ~0      
          1        GET_CLASS                                        ~1      ~0
          2        ECHO                                                     ~1
   14     3      > RETURN                                                   null

End of function dostuff

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.27 ms | 1439 KiB | 13 Q