3v4l.org

run code in 300+ PHP versions simultaneously
<?php function doopScooper($dataArray, $uniqueKeys){ foreach($dataArray as $k=>$row){ $checkArray = []; foreach($uniqueKeys as $key){ $checkArray[$key] = isset($row[$key]) ? $row[$key] : NULL; } var_dump($checkArray); exit; } } $dataArray = array( array("id"=>0, "fname"=>"Robert", "lname"=>"Pamblam", "address"=>"1231 main st"), array("id"=>1, "fname"=>"Robert", "lname"=>"Pamblam", "address"=>"1232 main st"), array("id"=>2, "fname"=>"Roberto", "lname"=>"Pamblam", "address"=>"1233 main st"), array("id"=>3, "fname"=>"Roberta", "lname"=>"Pamblam", "address"=>"1234 main st"), array("id"=>4, "fname"=>"Roberta", "lname"=>"Pamblam", "address"=>"1235 main st"), array("id"=>5, "fname"=>"Robert", "lname"=>"Pamblamo", "address"=>"1236 main st"), array("id"=>6, "fname"=>"Robert", "lname"=>"Pamblamo", "address"=>"1237 main st") ); $uniqueKeys = array('fname', 'lname'); $newarray = doopScooper($dataArray, $uniqueKeys); var_dump($newarray); exit;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/WUVbI
function name:  (null)
number of ops:  12
compiled vars:  !0 = $dataArray, !1 = $uniqueKeys, !2 = $newarray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ASSIGN                                                   !0, <array>
   24     1        ASSIGN                                                   !1, <array>
   25     2        INIT_FCALL                                               'doopscooper'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_FCALL                                      0  $5      
          6        ASSIGN                                                   !2, $5
   27     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                                 
         10      > EXIT                                                     
         11*     > RETURN                                                   1

Function doopscooper:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 23
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 23
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 17
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 17
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
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 = 7
Branch analysis from position: 7
Branch analysis from position: 17
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 17
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/WUVbI
function name:  doopScooper
number of ops:  25
compiled vars:  !0 = $dataArray, !1 = $uniqueKeys, !2 = $row, !3 = $k, !4 = $checkArray, !5 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2      > FE_RESET_R                                       $6      !0, ->23
          3    > > FE_FETCH_R                                       ~7      $6, !2, ->23
          4    >   ASSIGN                                                   !3, ~7
    5     5        ASSIGN                                                   !4, <array>
    6     6      > FE_RESET_R                                       $10     !1, ->17
          7    > > FE_FETCH_R                                               $10, !5, ->17
    7     8    >   ISSET_ISEMPTY_DIM_OBJ                         0          !2, !5
          9      > JMPZ                                                     ~12, ->13
         10    >   FETCH_DIM_R                                      ~13     !2, !5
         11        QM_ASSIGN                                        ~14     ~13
         12      > JMP                                                      ->14
         13    >   QM_ASSIGN                                        ~14     null
         14    >   ASSIGN_DIM                                               !4, !5
         15        OP_DATA                                                  ~14
    6    16      > JMP                                                      ->7
         17    >   FE_FREE                                                  $10
    9    18        INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !4
         20        DO_ICALL                                                 
         21      > EXIT                                                     
    4    22*       JMP                                                      ->3
         23    >   FE_FREE                                                  $6
   12    24      > RETURN                                                   null

End of function doopscooper

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.78 ms | 1394 KiB | 16 Q