3v4l.org

run code in 300+ PHP versions simultaneously
<?php foreach (range(1, 10) as $num) { $fun = function () use ($num) { return $num; }; } echo $fun();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/CQoJD
function name:  (null)
number of ops:  15
compiled vars:  !0 = $num, !1 = $fun
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'range'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 10
          3        DO_ICALL                                         $2      
          4      > FE_RESET_R                                       $3      $2, ->10
          5    > > FE_FETCH_R                                               $3, !0, ->10
    4     6    >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FCQoJD%3A4%240'
          7        BIND_LEXICAL                                             ~4, !0
          8        ASSIGN                                                   !1, ~4
    3     9      > JMP                                                      ->5
         10    >   FE_FREE                                                  $3
    7    11        INIT_DYNAMIC_CALL                                        !1
         12        DO_FCALL                                      0  $6      
         13        ECHO                                                     $6
         14      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FCQoJD%3A4%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.29 ms | 1395 KiB | 15 Q