3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(0); $array = ["foo", 124, 42, "bar"]; $actions = [ function() use($array, &$actions, &$i) { // Do something with $array[$i] $actions[!isset($array[++$i])](); }, function() { /* abort */ } ]; $i = 0; $actions[!isset($array[$i])](); var_dump(get_defined_vars());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RNsuS
function name:  (null)
number of ops:  24
compiled vars:  !0 = $array, !1 = $actions, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 0
          2        DO_ICALL                                                 
    5     3        ASSIGN                                                   !0, <array>
    8     4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FRNsuS%3A8%240'
          5        BIND_LEXICAL                                             ~5, !0
          6        BIND_LEXICAL                                             ~5, !1
          7        BIND_LEXICAL                                             ~5, !2
   11     8        INIT_ARRAY                                       ~6      ~5
   12     9        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FRNsuS%3A12%241'
         10        ADD_ARRAY_ELEMENT                                ~6      ~7
    7    11        ASSIGN                                                   !1, ~6
   14    12        ASSIGN                                                   !2, 0
   15    13        ISSET_ISEMPTY_DIM_OBJ                         0  ~10     !0, !2
         14        BOOL_NOT                                         ~11     ~10
         15        FETCH_DIM_R                                      ~12     !1, ~11
         16        INIT_DYNAMIC_CALL                                        ~12
         17        DO_FCALL                                      0          
   17    18        INIT_FCALL                                               'var_dump'
         19        INIT_FCALL                                               'get_defined_vars'
         20        DO_ICALL                                         $14     
         21        SEND_VAR                                                 $14
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FRNsuS%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RNsuS
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $array, !1 = $actions, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   BIND_STATIC                                              !0
          1        BIND_STATIC                                              !1
          2        BIND_STATIC                                              !2
   10     3        PRE_INC                                          ~3      !2
          4        ISSET_ISEMPTY_DIM_OBJ                         0  ~4      !0, ~3
          5        BOOL_NOT                                         ~5      ~4
          6        FETCH_DIM_R                                      ~6      !1, ~5
          7        INIT_DYNAMIC_CALL                                        ~6
          8        DO_FCALL                                      0          
   11     9      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FRNsuS%3A8%240

Function %00%7Bclosure%7D%2Fin%2FRNsuS%3A12%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RNsuS
function name:  {closure}
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E > > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.52 ms | 1400 KiB | 19 Q