3v4l.org

run code in 300+ PHP versions simultaneously
<?php $oldpages = array( 'products.php' => '/products/', 'news.php' => '/news/', 'about.php' => '/about' ); $app = 'foo'; foreach ($oldpages as $route => $newroute) { $a = function () use ($app, $newroute) { var_dump($app, $newroute); }; $a(); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 12
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/sNdg7
function name:  (null)
number of ops:  14
compiled vars:  !0 = $oldpages, !1 = $app, !2 = $newroute, !3 = $route, !4 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, 'foo'
   10     2      > FE_RESET_R                                       $7      !0, ->12
          3    > > FE_FETCH_R                                       ~8      $7, !2, ->12
          4    >   ASSIGN                                                   !3, ~8
   11     5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FsNdg7%3A11%240'
          6        BIND_LEXICAL                                             ~10, !1
          7        BIND_LEXICAL                                             ~10, !2
          8        ASSIGN                                                   !4, ~10
   14     9        INIT_DYNAMIC_CALL                                        !4
         10        DO_FCALL                                      0          
   10    11      > JMP                                                      ->3
         12    >   FE_FREE                                                  $7
   15    13      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FsNdg7%3A11%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.8 ms | 1395 KiB | 15 Q