3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = [ [ 'Access ID' => 12345, 'Registration Date' => '2018-02-27', 'First Name' => 'Damian', 'Last Name' => 'Martin', 'Flying Tour' => '' ], [ 'Access ID' => 12345, 'Registration Date' => '2018-02-27', 'First Name' => 'Damian', 'Last Name' => 'Martin', 'Flying Tour' => 'Yes going' ], [ 'Access ID' => 789456, 'Registration Date' => '2018-03-27', 'First Name' => 'Ricky', 'Last Name' => 'Smith', 'Flying Tour' => '' ], [ 'Access ID' => 789456, 'Registration Date' => '2018-03-27', 'First Name' => 'Ricky', 'Last Name' => 'Smith', 'Flying Tour' => 'Two way going', ], [ 'Access ID' => 987654, 'Registration Date' => '2018-04-27', 'First Name' => 'Darron', 'Last Name' => 'Butt', 'Flying Tour' => '' ] ]; $results = []; foreach ($data as $input) { if (!isset($results[$input['Access ID'] . '_' . $input['First Name'] . '_' . $input['Last Name']])) { $results[$input['Access ID'] . '_' . $input['First Name'] . '_' . $input['Last Name']] = $input; } else { if ($results[$input['Access ID'] . '_' . $input['First Name'] . '_' . $input['Last Name']]['Flying Tour'] == '') { $results[$input['Access ID'] . '_' . $input['First Name'] . '_' . $input['Last Name']] = $input; } } } $results = array_values($results); print_r($results);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 45
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 45
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 24
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 44
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 44
Branch analysis from position: 45
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 45
filename:       /in/2KcSN
function name:  (null)
number of ops:  54
compiled vars:  !0 = $data, !1 = $results, !2 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   41     1        ASSIGN                                                   !1, <array>
   42     2      > FE_RESET_R                                       $5      !0, ->45
          3    > > FE_FETCH_R                                               $5, !2, ->45
   43     4    >   FETCH_DIM_R                                      ~6      !2, 'Access+ID'
          5        CONCAT                                           ~7      ~6, '_'
          6        FETCH_DIM_R                                      ~8      !2, 'First+Name'
          7        CONCAT                                           ~9      ~7, ~8
          8        CONCAT                                           ~10     ~9, '_'
          9        FETCH_DIM_R                                      ~11     !2, 'Last+Name'
         10        CONCAT                                           ~12     ~10, ~11
         11        ISSET_ISEMPTY_DIM_OBJ                         0  ~13     !1, ~12
         12        BOOL_NOT                                         ~14     ~13
         13      > JMPZ                                                     ~14, ->24
   44    14    >   FETCH_DIM_R                                      ~15     !2, 'Access+ID'
         15        CONCAT                                           ~16     ~15, '_'
         16        FETCH_DIM_R                                      ~17     !2, 'First+Name'
         17        CONCAT                                           ~18     ~16, ~17
         18        CONCAT                                           ~19     ~18, '_'
         19        FETCH_DIM_R                                      ~20     !2, 'Last+Name'
         20        CONCAT                                           ~21     ~19, ~20
         21        ASSIGN_DIM                                               !1, ~21
         22        OP_DATA                                                  !2
   43    23      > JMP                                                      ->44
   46    24    >   FETCH_DIM_R                                      ~23     !2, 'Access+ID'
         25        CONCAT                                           ~24     ~23, '_'
         26        FETCH_DIM_R                                      ~25     !2, 'First+Name'
         27        CONCAT                                           ~26     ~24, ~25
         28        CONCAT                                           ~27     ~26, '_'
         29        FETCH_DIM_R                                      ~28     !2, 'Last+Name'
         30        CONCAT                                           ~29     ~27, ~28
         31        FETCH_DIM_R                                      ~30     !1, ~29
         32        FETCH_DIM_R                                      ~31     ~30, 'Flying+Tour'
         33        IS_EQUAL                                                 ~31, ''
         34      > JMPZ                                                     ~32, ->44
   47    35    >   FETCH_DIM_R                                      ~33     !2, 'Access+ID'
         36        CONCAT                                           ~34     ~33, '_'
         37        FETCH_DIM_R                                      ~35     !2, 'First+Name'
         38        CONCAT                                           ~36     ~34, ~35
         39        CONCAT                                           ~37     ~36, '_'
         40        FETCH_DIM_R                                      ~38     !2, 'Last+Name'
         41        CONCAT                                           ~39     ~37, ~38
         42        ASSIGN_DIM                                               !1, ~39
         43        OP_DATA                                                  !2
   42    44    > > JMP                                                      ->3
         45    >   FE_FREE                                                  $5
   52    46        INIT_FCALL                                               'array_values'
         47        SEND_VAR                                                 !1
         48        DO_ICALL                                         $41     
         49        ASSIGN                                                   !1, $41
   54    50        INIT_FCALL                                               'print_r'
         51        SEND_VAR                                                 !1
         52        DO_ICALL                                                 
         53      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.36 ms | 1008 KiB | 15 Q