3v4l.org

run code in 300+ PHP versions simultaneously
<?php $count = []; $callback = function ($i) use ($count) { $count[] = $i; var_dump($count); }; for ($i = 0; $i < 4; $i++) { call_user_func($callback, $i); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 6
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 6
Branch analysis from position: 12
Branch analysis from position: 6
filename:       /in/S8m8X
function name:  (null)
number of ops:  13
compiled vars:  !0 = $count, !1 = $callback, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FS8m8X%3A3%240'
          2        BIND_LEXICAL                                             ~4, !0
          3        ASSIGN                                                   !1, ~4
    7     4        ASSIGN                                                   !2, 0
          5      > JMP                                                      ->10
    8     6    >   INIT_USER_CALL                                1          'call_user_func', !1
          7        SEND_USER                                                !2
          8        DO_FCALL                                      0          
    7     9        PRE_INC                                                  !2
         10    >   IS_SMALLER                                               !2, 4
         11      > JMPNZ                                                    ~9, ->6
    9    12    > > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FS8m8X%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S8m8X
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $i, !1 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
    4     2        ASSIGN_DIM                                               !1
          3        OP_DATA                                                  !0
    5     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                                 
    6     7      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FS8m8X%3A3%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.66 ms | 940 KiB | 16 Q