3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr= array ( 'supplier_id' => 1, 'filter_name' => array ( 0 => 'product 1', 1 => 'Product 2', 2 => 'Product 3' ), 'quantity' => array ( 0 => 3, 1 => 10, 2 => 2 ), 'unit' => array ( 0 => 'pkts', 1 => 'ltrs', 2 => 'pkts' ), 'price' => Array ( 0 => 11, 1 => 100, 2 => 10 ), 'gross_amount' => Array ( 0 => 33, 1 => 1000, 2 => 20 ), 'vat' => array ( 0 => 0, 1 => 0, 2 => 0 ), 'net_amount' => array ( 0 => 33, 1 => 1000, 2 => 20 ), ); //echo "<pre>"; print_r($arr); $i = 0; $newArray = array(); do{ foreach($arr as $key=>$val){ if($key == 'supplier_id'){ $newArray[$key] = $val; }else{ $newArray[$i][$key] = $val[$i]; } } $i++; }while($i<3); echo "<pre>"; print_r($newArray);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 16
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 3
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
Branch analysis from position: 16
filename:       /in/j49Qe
function name:  (null)
number of ops:  25
compiled vars:  !0 = $arr, !1 = $i, !2 = $newArray, !3 = $val, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   48     1        ASSIGN                                                   !1, 0
   49     2        ASSIGN                                                   !2, <array>
   51     3    > > FE_RESET_R                                       $8      !0, ->16
          4    > > FE_FETCH_R                                       ~9      $8, !3, ->16
          5    >   ASSIGN                                                   !4, ~9
   52     6        IS_EQUAL                                                 !4, 'supplier_id'
          7      > JMPZ                                                     ~11, ->11
   53     8    >   ASSIGN_DIM                                               !2, !4
          9        OP_DATA                                                  !3
   52    10      > JMP                                                      ->15
   55    11    >   FETCH_DIM_R                                      ~15     !3, !1
         12        FETCH_DIM_W                                      $13     !2, !1
         13        ASSIGN_DIM                                               $13, !4
         14        OP_DATA                                                  ~15
   51    15    > > JMP                                                      ->4
         16    >   FE_FREE                                                  $8
   59    17        PRE_INC                                                  !1
   60    18        IS_SMALLER                                               !1, 3
         19      > JMPNZ                                                    ~17, ->3
   61    20    >   ECHO                                                     '%3Cpre%3E'
         21        INIT_FCALL                                               'print_r'
         22        SEND_VAR                                                 !2
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.08 ms | 1438 KiB | 14 Q