3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input['links']["link"] = ["onet.pl", "wp.pl"]; $input['links']["title"] = ["Link 1", "Link 2"]; function rebuildArray($input) { foreach($input['links'] as $key => $value) { $index = 0; foreach($value as $value2) { $arr2[$index++][$key]=$value2; } } $output['links'] = $arr2; return $output; } var_dump(rebuildArray($input));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/udoGS
function name:  (null)
number of ops:  13
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   FETCH_DIM_W                                      $1      !0, 'links'
          1        ASSIGN_DIM                                               $1, 'link'
          2        OP_DATA                                                  <array>
    3     3        FETCH_DIM_W                                      $3      !0, 'links'
          4        ASSIGN_DIM                                               $3, 'title'
          5        OP_DATA                                                  <array>
   16     6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'rebuildarray'
          8        SEND_VAR                                                 !0
          9        DO_FCALL                                      0  $5      
         10        SEND_VAR                                                 $5
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Function rebuildarray:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 13
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 13
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/udoGS
function name:  rebuildArray
number of ops:  20
compiled vars:  !0 = $input, !1 = $value, !2 = $key, !3 = $index, !4 = $value2, !5 = $arr2, !6 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        FETCH_DIM_R                                      ~7      !0, 'links'
          2      > FE_RESET_R                                       $8      ~7, ->15
          3    > > FE_FETCH_R                                       ~9      $8, !1, ->15
          4    >   ASSIGN                                                   !2, ~9
    7     5        ASSIGN                                                   !3, 0
    8     6      > FE_RESET_R                                       $12     !1, ->13
          7    > > FE_FETCH_R                                               $12, !4, ->13
    9     8    >   POST_INC                                         ~13     !3
          9        FETCH_DIM_W                                      $14     !5, ~13
         10        ASSIGN_DIM                                               $14, !2
         11        OP_DATA                                                  !4
    8    12      > JMP                                                      ->7
         13    >   FE_FREE                                                  $12
    6    14      > JMP                                                      ->3
         15    >   FE_FREE                                                  $8
   12    16        ASSIGN_DIM                                               !6, 'links'
         17        OP_DATA                                                  !5
   13    18      > RETURN                                                   !6
   14    19*     > RETURN                                                   null

End of function rebuildarray

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.41 ms | 1403 KiB | 16 Q