3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = range(1,25); $b = array('21'=>'test'); $t = array_map(function($a){ return associate($a, $b);}, $a); function associate($av, $b) { $r = (isset($b[$av]))?$b[$av]:null; } print_r($t);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TJYWq
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%2FTJYWq%3A6%240'
          8        SEND_VAL                                                 ~6
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $7      
         11        ASSIGN                                                   !2, $7
   13    12        INIT_FCALL                                               'print_r'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

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

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

Function associate:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TJYWq
function name:  associate
number of ops:  10
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      
    9     2        ISSET_ISEMPTY_DIM_OBJ                         0          !1, !0
          3      > JMPZ                                                     ~3, ->7
          4    >   FETCH_DIM_R                                      ~4      !1, !0
          5        QM_ASSIGN                                        ~5      ~4
          6      > JMP                                                      ->8
          7    >   QM_ASSIGN                                        ~5      null
          8    >   ASSIGN                                                   !2, ~5
   10     9      > RETURN                                                   null

End of function associate

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.56 ms | 1400 KiB | 19 Q