3v4l.org

run code in 300+ PHP versions simultaneously
<?php $one = Array ( 4 => 'bim', 5 => 'pow', 6 => 'foo' ); $two = Array ( 'n' => Array ( 0 => 1 ), 'm' => Array ( 0 => 1, 1 => 2 ), 'l' => Array ( 0 => 1, 1 => 4, 2 => 64 ) ); $result = []; while((list($oneKey, $oneValue) = each($one)) && (list($twoKey, $twoValue) = each($two))) { $result[$oneValue] = array_map(function($item) use ($twoKey) { return $twoKey.'-'.$item; }, $twoValue); }; var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 46) Position 1 = 20, Position 2 = 28
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 4
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 46) Position 1 = 20, Position 2 = 28
Branch analysis from position: 20
Branch analysis from position: 28
Branch analysis from position: 28
filename:       /in/nPa4W
function name:  (null)
number of ops:  33
compiled vars:  !0 = $one, !1 = $two, !2 = $result, !3 = $oneValue, !4 = $twoKey, !5 = $twoValue, !6 = $oneKey
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, <array>
   29     2        ASSIGN                                                   !2, <array>
   30     3      > JMP                                                      ->12
   33     4    >   INIT_FCALL                                               'array_map'
          5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FnPa4W%3A33%240'
          6        BIND_LEXICAL                                             ~11, !4
   36     7        SEND_VAL                                                 ~11
          8        SEND_VAR                                                 !5
          9        DO_ICALL                                         $12     
   33    10        ASSIGN_DIM                                               !2, !3
   36    11        OP_DATA                                                  $12
   30    12    >   INIT_FCALL_BY_NAME                                       'each'
         13        SEND_VAR_EX                                              !0
         14        DO_FCALL                                      0  $13     
         15        FETCH_LIST_R                                     $14     $13, 0
         16        ASSIGN                                                   !6, $14
         17        FETCH_LIST_R                                     $16     $13, 1
         18        ASSIGN                                                   !3, $16
         19      > JMPZ_EX                                          ~18     $13, ->28
   31    20    >   INIT_FCALL_BY_NAME                                       'each'
         21        SEND_VAR_EX                                              !1
         22        DO_FCALL                                      0  $19     
         23        FETCH_LIST_R                                     $20     $19, 0
         24        ASSIGN                                                   !4, $20
         25        FETCH_LIST_R                                     $22     $19, 1
         26        ASSIGN                                                   !5, $22
         27        BOOL                                             ~18     $19
         28    > > JMPNZ                                                    ~18, ->4
   38    29    >   INIT_FCALL                                               'var_dump'
         30        SEND_VAR                                                 !2
         31        DO_ICALL                                                 
         32      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FnPa4W%3A33%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.78 ms | 945 KiB | 18 Q