3v4l.org

run code in 500+ PHP versions simultaneously
<?php $allHotels = array('Rows' => array ( 0 => array ( 'HotelId' => 94852, 'OfferId' => 858080496, 'OfferIdStr' => '858080496', 'Price' => 2762, ), 1 => array ( 'HotelId' => 94852, 'OfferId' => 858080497, 'OfferIdStr' => '858080497', 'Price' => 3000, ), 2 => array ( 'HotelId' => 93369, 'OfferId' => 858080501, 'OfferIdStr' => '858080501', 'Price' => 2500, ) )); $seenHotels = array(); foreach ($allHotels['Rows'] as $key => $hotel) { if (in_array($hotel['HotelId'], $seenHotels)) { unset($allHotels['Rows'][$key]); } else { $seenHotels[] = $hotel['HotelId']; } } print_r($allHotels);
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 = 9, Position 2 = 12
Branch analysis from position: 9
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: 12
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/AtmDb
function name:  (null)
number of ops:  21
compiled vars:  !0 = $allHotels, !1 = $seenHotels, !2 = $hotel, !3 = $key
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   28     1        ASSIGN                                                       !1, <array>
   29     2        FETCH_DIM_R                                          ~6      !0, 'Rows'
          3      > FE_RESET_R                                           $7      ~6, ->16
          4    > > FE_FETCH_R                                           ~8      $7, !2, ->16
          5    >   ASSIGN                                                       !3, ~8
   30     6        FETCH_DIM_R                                          ~10     !2, 'HotelId'
          7        FRAMELESS_ICALL_2                in_array            ~11     ~10, !1
          8      > JMPZ                                                         ~11, ->12
   31     9    >   FETCH_DIM_UNSET                                      $12     !0, 'Rows'
         10        UNSET_DIM                                                    $12, !3
   30    11      > JMP                                                          ->15
   34    12    >   FETCH_DIM_R                                          ~14     !2, 'HotelId'
         13        ASSIGN_DIM                                                   !1
         14        OP_DATA                                                      ~14
   29    15    > > JMP                                                          ->4
         16    >   FE_FREE                                                      $7
   37    17        INIT_FCALL                                                   'print_r'
         18        SEND_VAR                                                     !0
         19        DO_ICALL                                                     
         20      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
170.91 ms | 2238 KiB | 14 Q