3v4l.org

run code in 500+ PHP versions simultaneously
<?php $keyArray = array("clientId","clientName","clientAdsress","clientPhone"); $valuesArray = array( "0"=>array("1001","aaaaa","ddddddd","22222222"), "1"=>array("1002","bbbbbb","ddddddd","11111111"), "2"=>array("1003","ccccc","ddddddd","33333333") ); $expected = array( "clientId"=>array("1001","1002","1003"), "clientName"=>array("aaaaa","bbbbbb","ccccc"), "clientAdsress"=>array("ddddddd","ddddddd","ddddddd"), "clientPhone"=>array("22222222","11111111","33333333") ); $result = []; foreach($keyArray as $key => $keyName) { foreach($valuesArray as $value) { $result[$keyName][] = $value[$key]; } } var_dump($result === $expected);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 16
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 16
Branch analysis from position: 6
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 14
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/gbBad
function name:  (null)
number of ops:  22
compiled vars:  !0 = $keyArray, !1 = $valuesArray, !2 = $expected, !3 = $result, !4 = $keyName, !5 = $key, !6 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        ASSIGN                                                       !1, <array>
    9     2        ASSIGN                                                       !2, <array>
   16     3        ASSIGN                                                       !3, <array>
   17     4      > FE_RESET_R                                           $11     !0, ->16
          5    > > FE_FETCH_R                                           ~12     $11, !4, ->16
          6    >   ASSIGN                                                       !5, ~12
   18     7      > FE_RESET_R                                           $14     !1, ->14
          8    > > FE_FETCH_R                                                   $14, !6, ->14
   19     9    >   FETCH_DIM_R                                          ~17     !6, !5
         10        FETCH_DIM_W                                          $15     !3, !4
         11        ASSIGN_DIM                                                   $15
         12        OP_DATA                                                      ~17
   18    13      > JMP                                                          ->8
         14    >   FE_FREE                                                      $14
   17    15      > JMP                                                          ->5
         16    >   FE_FREE                                                      $11
   23    17        INIT_FCALL                                                   'var_dump'
         18        IS_IDENTICAL                                         ~18     !3, !2
         19        SEND_VAL                                                     ~18
         20        DO_ICALL                                                     
         21      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
170.87 ms | 3238 KiB | 14 Q