3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [7, 5, 6, 9]; $b = [1, 3, 2, 4]; $c = array_combine($a,$b); $r = []; array_walk($c, function($k,$v) use (&$r){$r[] = "{$v}-{$k}";}); print_r($r);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fIJEs
function name:  (null)
number of ops:  18
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    5     2        INIT_FCALL                                               'array_combine'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !2, $6
    6     7        ASSIGN                                                   !3, <array>
    7     8        INIT_FCALL                                               'array_walk'
          9        SEND_REF                                                 !2
         10        DECLARE_LAMBDA_FUNCTION                          ~9      [0]
         11        BIND_LEXICAL                                             ~9, !3
         12        SEND_VAL                                                 ~9
         13        DO_ICALL                                                 
    8    14        INIT_FCALL                                               'print_r'
         15        SEND_VAR                                                 !3
         16        DO_ICALL                                                 
         17      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fIJEs
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $k, !1 = $v, !2 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
          3        ROPE_INIT                                     3  ~5      !1
          4        ROPE_ADD                                      1  ~5      ~5, '-'
          5        ROPE_END                                      2  ~4      ~5, !0
          6        ASSIGN_DIM                                               !2
          7        OP_DATA                                                  ~4
          8      > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
258.16 ms | 1012 KiB | 16 Q