3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f($x) { echo $x; } $funs = array(); for ($i=0; $i<10; $i++) { $funs[] = function($i) { f($i); }; } for ($i=0; $i<10; $i++) { $g = $funs[$i]; $g(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 3
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 11
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 11
Branch analysis from position: 18
Branch analysis from position: 11
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 3
Branch analysis from position: 9
Branch analysis from position: 3
filename:       /in/QnZ6T
function name:  (null)
number of ops:  19
compiled vars:  !0 = $funs, !1 = $i, !2 = $g
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->7
    9     3    >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FQnZ6T%3A9%240'
          4        ASSIGN_DIM                                               !0
          5        OP_DATA                                                  ~6
    8     6        PRE_INC                                                  !1
          7    >   IS_SMALLER                                               !1, 10
          8      > JMPNZ                                                    ~8, ->3
   12     9    >   ASSIGN                                                   !1, 0
         10      > JMP                                                      ->16
   13    11    >   FETCH_DIM_R                                      ~10     !0, !1
         12        ASSIGN                                                   !2, ~10
   14    13        INIT_DYNAMIC_CALL                                        !2
         14        DO_FCALL                                      0          
   12    15        PRE_INC                                                  !1
         16    >   IS_SMALLER                                               !1, 10
         17      > JMPNZ                                                    ~14, ->11
   15    18    > > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QnZ6T
function name:  f
number of ops:  3
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ECHO                                                     !0
    5     2      > RETURN                                                   null

End of function f

Function %00%7Bclosure%7D%2Fin%2FQnZ6T%3A9%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QnZ6T
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'f'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0          
          4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FQnZ6T%3A9%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.61 ms | 1394 KiB | 14 Q