3v4l.org

run code in 500+ PHP versions simultaneously
<?php $data = [ ['dest' => 960, 'dis' => 'ANSWERED'], ['dest' => 596, 'dis' => 'NO ANSWER'], ['dest' => 596, 'dis' => 'ANSWERED'], ['dest' => 595, 'dis' => 'NO ANSWER'], ['dest' => 595, 'dis' => 'NO ANSWER'], ]; $result =[]; foreach ($data as $row) { if (!isset($result[$row['dest']]) || $row['dis'] === 'ANSWERED') { $result[$row['dest']] = $row; } } var_export(array_values($result));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 16
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
2 jumps found. (Code = 47) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 15
Branch analysis from position: 11
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/9OVM0
function name:  (null)
number of ops:  24
compiled vars:  !0 = $data, !1 = $result, !2 = $row
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   11     1        ASSIGN                                                       !1, <array>
   12     2      > FE_RESET_R                                           $5      !0, ->16
          3    > > FE_FETCH_R                                                   $5, !2, ->16
   13     4    >   FETCH_DIM_R                                          ~6      !2, 'dest'
          5        ISSET_ISEMPTY_DIM_OBJ                             0  ~7      !1, ~6
          6        BOOL_NOT                                             ~8      ~7
          7      > JMPNZ_EX                                             ~8      ~8, ->11
          8    >   FETCH_DIM_R                                          ~9      !2, 'dis'
          9        IS_IDENTICAL                                         ~10     ~9, 'ANSWERED'
         10        BOOL                                                 ~8      ~10
         11    > > JMPZ                                                         ~8, ->15
   14    12    >   FETCH_DIM_R                                          ~11     !2, 'dest'
         13        ASSIGN_DIM                                                   !1, ~11
         14        OP_DATA                                                      !2
   12    15    > > JMP                                                          ->3
         16    >   FE_FREE                                                      $5
   17    17        INIT_FCALL                                                   'var_export'
         18        INIT_FCALL                                                   'array_values'
         19        SEND_VAR                                                     !1
         20        DO_ICALL                                             $13     
         21        SEND_VAR                                                     $13
         22        DO_ICALL                                                     
         23      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
171.07 ms | 2013 KiB | 15 Q