3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = range(1,25); $b = array('21'=>'test'); $t = array_map(function($a){ global $b; return associate($a, $b);}, $a); function associate($av, $b) { //$r = (isset($b[$av]))?$b[$av]:null; $r = gettype($b); } print_r($t);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IHhuO
function name:  (null)
number of ops:  16
compiled vars:  !0 = $a, !1 = $b, !2 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'range'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 25
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !0, $3
    4     5        ASSIGN                                                   !1, <array>
    6     6        INIT_FCALL                                               'array_map'
          7        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FIHhuO%3A6%240'
          8        SEND_VAL                                                 ~6
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $7      
         11        ASSIGN                                                   !2, $7
   15    12        INIT_FCALL                                               'print_r'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FIHhuO%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IHhuO
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        BIND_GLOBAL                                              !1, 'b'
          2        INIT_FCALL_BY_NAME                                       'associate'
          3        SEND_VAR_EX                                              !0
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0  $2      
          6      > RETURN                                                   $2
          7*     > RETURN                                                   null

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

Function associate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IHhuO
function name:  associate
number of ops:  5
compiled vars:  !0 = $av, !1 = $b, !2 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   11     2        GET_TYPE                                         ~3      !1
          3        ASSIGN                                                   !2, ~3
   12     4      > RETURN                                                   null

End of function associate

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.09 ms | 1396 KiB | 19 Q