3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a{ static public $b; static public function init(){ (self::$b)(); self::$b=function(){}; } } a::$b=function(){echo 'Here I do very heavy stuff, but will happen only in the first time I call init()';}; for($i=0;$i<3;$i++){ a::init(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 5
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 5
Branch analysis from position: 10
Branch analysis from position: 5
filename:       /in/T5J8m
function name:  (null)
number of ops:  11
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FT5J8m%3A10%241'
          1        ASSIGN_STATIC_PROP                                       'b', 'a'
          2        OP_DATA                                                  ~2
   12     3        ASSIGN                                                   !0, 0
          4      > JMP                                                      ->8
   13     5    >   INIT_STATIC_METHOD_CALL                                  'a', 'init'
          6        DO_FCALL                                      0          
   12     7        PRE_INC                                                  !0
          8    >   IS_SMALLER                                               !0, 3
          9      > JMPNZ                                                    ~6, ->5
   14    10    > > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FT5J8m%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/T5J8m
function name:  {closure}
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FT5J8m%3A7%240

Function %00%7Bclosure%7D%2Fin%2FT5J8m%3A10%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/T5J8m
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ECHO                                                     'Here+I+do+very+heavy+stuff%2C+but+will+happen+only+in+the+first+time+I+call+init%28%29'
          1      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FT5J8m%3A10%241

Class a:
Function init:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/T5J8m
function name:  init
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'b'
          1        INIT_DYNAMIC_CALL                                        ~0
          2        DO_FCALL                                      0          
    7     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FT5J8m%3A7%240'
          4        ASSIGN_STATIC_PROP                                       'b'
          5        OP_DATA                                                  ~3
    8     6      > RETURN                                                   null

End of function init

End of class a.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.62 ms | 1395 KiB | 13 Q