3v4l.org

run code in 300+ PHP versions simultaneously
<?php for ($closure = function($a, $b) { return $a * $b; }, $a = 0, $b = 0, $i = 10; $closure($a, $b) < $i; $i++, $a++, $b++) {} var_dump($a, $b, $i);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 6
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 6
Branch analysis from position: 15
Branch analysis from position: 6
filename:       /in/X3R8U
function name:  (null)
number of ops:  21
compiled vars:  !0 = $closure, !1 = $a, !2 = $b, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          1        ASSIGN                                                   !0, ~4
          2        ASSIGN                                                   !1, 0
          3        ASSIGN                                                   !2, 0
          4        ASSIGN                                                   !3, 10
          5      > JMP                                                      ->9
          6    >   PRE_INC                                                  !3
          7        PRE_INC                                                  !1
          8        PRE_INC                                                  !2
          9    >   INIT_DYNAMIC_CALL                                        !0
         10        SEND_VAR_EX                                              !1
         11        SEND_VAR_EX                                              !2
         12        DO_FCALL                                      0  $12     
         13        IS_SMALLER                                               $12, !3
         14      > JMPNZ                                                    ~13, ->6
    4    15    >   INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !1
         17        SEND_VAR                                                 !2
         18        SEND_VAR                                                 !3
         19        DO_ICALL                                                 
         20      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/X3R8U
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        MUL                                              ~2      !0, !1
          3      > RETURN                                                   ~2
          4*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.55 ms | 1006 KiB | 14 Q