3v4l.org

run code in 300+ PHP versions simultaneously
<?php function start( $entrance, array $route ) { $stage = []; $register = function( $on, $append ) use ( &$stage ) { if ( isset( $stage[$on] ) ) $stage[$on][] = $append; else $stage[$on] = [ $append ]; return; }; $executor = function( $step ) use ( $register, &$stage ) { if ( 1 == $step ) { $register( 3, 5 ); $register( 3, 6 ); } echo $step; }; $register(); foreach( $route as $r ) { if ( isset( $stage[$r] ) ) foreach( $stage[$r] as $rr ) $executor( $rr ); $executor( $r ); } } start( 1, [ 1, 2, 3, 4 ] );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4iQcK
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   INIT_FCALL                                               'start'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 <array>
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Function start:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 28
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 28
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 24
Branch analysis from position: 16
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 23
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 23
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 23
Branch analysis from position: 24
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/4iQcK
function name:  start
number of ops:  30
compiled vars:  !0 = $entrance, !1 = $route, !2 = $stage, !3 = $register, !4 = $executor, !5 = $r, !6 = $rr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        ASSIGN                                                   !2, <array>
    6     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F4iQcK%3A6%240'
          4        BIND_LEXICAL                                             ~8, !2
          5        ASSIGN                                                   !3, ~8
   12     6        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F4iQcK%3A12%241'
          7        BIND_LEXICAL                                             ~10, !3
          8        BIND_LEXICAL                                             ~10, !2
          9        ASSIGN                                                   !4, ~10
   22    10        INIT_DYNAMIC_CALL                                        !3
         11        DO_FCALL                                      0          
   23    12      > FE_RESET_R                                       $13     !1, ->28
         13    > > FE_FETCH_R                                               $13, !5, ->28
   24    14    >   ISSET_ISEMPTY_DIM_OBJ                         0          !2, !5
         15      > JMPZ                                                     ~14, ->24
         16    >   FETCH_DIM_R                                      ~15     !2, !5
         17      > FE_RESET_R                                       $16     ~15, ->23
         18    > > FE_FETCH_R                                               $16, !6, ->23
   25    19    >   INIT_DYNAMIC_CALL                                        !4
         20        SEND_VAR_EX                                              !6
         21        DO_FCALL                                      0          
   24    22      > JMP                                                      ->18
         23    >   FE_FREE                                                  $16
   25    24    >   INIT_DYNAMIC_CALL                                        !4
         25        SEND_VAR_EX                                              !5
         26        DO_FCALL                                      0          
   23    27      > JMP                                                      ->13
         28    >   FE_FREE                                                  $13
   28    29      > RETURN                                                   null

End of function start

Function %00%7Bclosure%7D%2Fin%2F4iQcK%3A6%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4iQcK
function name:  {closure}
number of ops:  14
compiled vars:  !0 = $on, !1 = $append, !2 = $stage
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
    7     3        ISSET_ISEMPTY_DIM_OBJ                         0          !2, !0
          4      > JMPZ                                                     ~3, ->9
          5    >   FETCH_DIM_W                                      $4      !2, !0
          6        ASSIGN_DIM                                               $4
          7        OP_DATA                                                  !1
          8      > JMP                                                      ->12
    8     9    >   INIT_ARRAY                                       ~7      !1
         10        ASSIGN_DIM                                               !2, !0
         11        OP_DATA                                                  ~7
    9    12    > > RETURN                                                   null
   10    13*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F4iQcK%3A6%240

Function %00%7Bclosure%7D%2Fin%2F4iQcK%3A12%241:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 13
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/4iQcK
function name:  {closure}
number of ops:  15
compiled vars:  !0 = $step, !1 = $register, !2 = $stage
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        BIND_STATIC                                              !2
   14     3        IS_EQUAL                                                 !0, 1
          4      > JMPZ                                                     ~3, ->13
   15     5    >   INIT_DYNAMIC_CALL                                        !1
          6        SEND_VAL_EX                                              3
          7        SEND_VAL_EX                                              5
          8        DO_FCALL                                      0          
   16     9        INIT_DYNAMIC_CALL                                        !1
         10        SEND_VAL_EX                                              3
         11        SEND_VAL_EX                                              6
         12        DO_FCALL                                      0          
   19    13    >   ECHO                                                     !0
   20    14      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F4iQcK%3A12%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.8 ms | 1407 KiB | 14 Q