3v4l.org

run code in 300+ PHP versions simultaneously
<? $arData = array( 0 => array( 'number' => '+934543534' ), 1 => array( 'carrier' => 'plumber' ), 2 => array( 'number' => '+3253245235' ), 3 => array( 'carrier' => 'police' ), 4 => array( 'number' => '+11113534' ), 5 => array( 'carrier' => 'banker' ) ); $arResult = array(); foreach ($arData as $key => $arValue) { $arResult[intval($key/2)][key($arValue)] = $arValue[key($arValue)]; } echo '<pre>'; print_r($arResult); echo '</pre>';
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 18
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 18
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/J3Paq
function name:  (null)
number of ops:  25
compiled vars:  !0 = $arData, !1 = $arResult, !2 = $arValue, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   22     1        ASSIGN                                                   !1, <array>
   23     2      > FE_RESET_R                                       $6      !0, ->18
          3    > > FE_FETCH_R                                       ~7      $6, !2, ->18
          4    >   ASSIGN                                                   !3, ~7
   24     5        DIV                                              ~9      !3, 2
          6        CAST                                          4  ~10     ~9
          7        INIT_FCALL                                               'key'
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                         $12     
         10        INIT_FCALL                                               'key'
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                         $14     
         13        FETCH_DIM_R                                      ~15     !2, $14
         14        FETCH_DIM_W                                      $11     !1, ~10
         15        ASSIGN_DIM                                               $11, $12
         16        OP_DATA                                                  ~15
   23    17      > JMP                                                      ->3
         18    >   FE_FREE                                                  $6
   26    19        ECHO                                                     '%3Cpre%3E'
   27    20        INIT_FCALL                                               'print_r'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                                 
   28    23        ECHO                                                     '%3C%2Fpre%3E'
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.85 ms | 1395 KiB | 17 Q