3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { static public $params = []; function init() { self::$params['func'] = function () { return 'yay'; }; } } class bar extends foo { function __construct() { parent::init(); echo parent::$params['func'](); } } new bar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rt6FT
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $0      'bar'
          1        DO_FCALL                                      0          
          2        FREE                                                     $0
          3      > RETURN                                                   1

Class foo:
Function init:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rt6FT
function name:  init
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_LAMBDA_FUNCTION                          ~2      [0]
          1        FETCH_STATIC_PROP_W          global              $0      'params'
          2        ASSIGN_DIM                                               $0, 'func'
    9     3        OP_DATA                                                  ~2
   10     4      > RETURN                                                   null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rt6FT
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E > > RETURN                                                   'yay'
    9     1*     > RETURN                                                   null

End of Dynamic Function 0

End of function init

End of class foo.

Class bar:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rt6FT
function name:  __construct
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_STATIC_METHOD_CALL                                  'init'
          1        DO_FCALL                                      0          
   16     2        FETCH_STATIC_PROP_R          unknown             ~1      'params'
          3        FETCH_DIM_R                                      ~2      ~1, 'func'
          4        INIT_DYNAMIC_CALL                                        ~2
          5        DO_FCALL                                      0  $3      
          6        ECHO                                                     $3
   17     7      > 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/rt6FT
function name:  init
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_LAMBDA_FUNCTION                          ~2      [0]
          1        FETCH_STATIC_PROP_W          global              $0      'params'
          2        ASSIGN_DIM                                               $0, 'func'
    9     3        OP_DATA                                                  ~2
   10     4      > RETURN                                                   null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rt6FT
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E > > RETURN                                                   'yay'
    9     1*     > RETURN                                                   null

End of Dynamic Function 0

End of function init

End of class bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.38 ms | 1000 KiB | 13 Q