3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1 = [1,2,3]; $arr2 = ["A","B","C"]; $arr = [["A"=>$arr1, "B"=>$arr2],["B"=>$arr1, "C"=>$arr2]]; $callback = function($v1, $v2){ return $v1."-".$v2; }; reset($arr[0]); reset($arr[1]); $res = []; while (current($arr[0]) !== false){ $key = key($arr[0])."-".key($tot[1]); $value = array_map($callback, current($arr[0]), current($arr[1])); $res[$key] = $value; next($arr[0]); next($arr[1]); } print_r($res);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 56
Branch analysis from position: 56
2 jumps found. (Code = 44) Position 1 = 62, Position 2 = 21
Branch analysis from position: 62
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 62, Position 2 = 21
Branch analysis from position: 62
Branch analysis from position: 21
filename:       /in/oXEQH
function name:  (null)
number of ops:  66
compiled vars:  !0 = $arr1, !1 = $arr2, !2 = $arr, !3 = $callback, !4 = $res, !5 = $key, !6 = $tot, !7 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    5     2        INIT_ARRAY                                       ~10     !0, 'A'
          3        ADD_ARRAY_ELEMENT                                ~10     !1, 'B'
          4        INIT_ARRAY                                       ~11     ~10
          5        INIT_ARRAY                                       ~12     !0, 'B'
          6        ADD_ARRAY_ELEMENT                                ~12     !1, 'C'
          7        ADD_ARRAY_ELEMENT                                ~11     ~12
          8        ASSIGN                                                   !2, ~11
    8     9        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FoXEQH%3A8%240'
         10        ASSIGN                                                   !3, ~14
    9    11        INIT_FCALL                                               'reset'
         12        FETCH_DIM_W                                      $16     !2, 0
         13        SEND_REF                                                 $16
         14        DO_ICALL                                                 
   10    15        INIT_FCALL                                               'reset'
         16        FETCH_DIM_W                                      $18     !2, 1
         17        SEND_REF                                                 $18
         18        DO_ICALL                                                 
   11    19        ASSIGN                                                   !4, <array>
   12    20      > JMP                                                      ->56
   13    21    >   INIT_FCALL                                               'key'
         22        FETCH_DIM_R                                      ~21     !2, 0
         23        SEND_VAL                                                 ~21
         24        DO_ICALL                                         $22     
         25        CONCAT                                           ~23     $22, '-'
         26        INIT_FCALL                                               'key'
         27        FETCH_DIM_R                                      ~24     !6, 1
         28        SEND_VAL                                                 ~24
         29        DO_ICALL                                         $25     
         30        CONCAT                                           ~26     ~23, $25
         31        ASSIGN                                                   !5, ~26
   14    32        INIT_FCALL                                               'array_map'
         33        SEND_VAR                                                 !3
         34        INIT_FCALL                                               'current'
         35        FETCH_DIM_R                                      ~28     !2, 0
         36        SEND_VAL                                                 ~28
         37        DO_ICALL                                         $29     
         38        SEND_VAR                                                 $29
         39        INIT_FCALL                                               'current'
         40        FETCH_DIM_R                                      ~30     !2, 1
         41        SEND_VAL                                                 ~30
         42        DO_ICALL                                         $31     
         43        SEND_VAR                                                 $31
         44        DO_ICALL                                         $32     
         45        ASSIGN                                                   !7, $32
   15    46        ASSIGN_DIM                                               !4, !5
         47        OP_DATA                                                  !7
   16    48        INIT_FCALL                                               'next'
         49        FETCH_DIM_W                                      $35     !2, 0
         50        SEND_REF                                                 $35
         51        DO_ICALL                                                 
   17    52        INIT_FCALL                                               'next'
         53        FETCH_DIM_W                                      $37     !2, 1
         54        SEND_REF                                                 $37
         55        DO_ICALL                                                 
   12    56    >   INIT_FCALL                                               'current'
         57        FETCH_DIM_R                                      ~39     !2, 0
         58        SEND_VAL                                                 ~39
         59        DO_ICALL                                         $40     
         60        TYPE_CHECK                                  1018          $40
         61      > JMPNZ                                                    ~41, ->21
   20    62    >   INIT_FCALL                                               'print_r'
         63        SEND_VAR                                                 !4
         64        DO_ICALL                                                 
         65      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FoXEQH%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oXEQH
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $v1, !1 = $v2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        CONCAT                                           ~2      !0, '-'
          3        CONCAT                                           ~3      ~2, !1
          4      > RETURN                                                   ~3
          5*     > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.72 ms | 1400 KiB | 25 Q