3v4l.org

run code in 300+ PHP versions simultaneously
<?php $finalArray = array ( 0 => array ( 'deviceMacAddress' => 'd4:fc:9b:81:87:32', 'pressure' => 1015.12, 'temperature' => 22.296875, 'co2' => '', 'voc' => '', 'humidity' => '', 'light' => 1, 'pm1' => '', 'pm25' => '', 'pm10' => '', 'timestamp' => 1644917014994, ), 1 => array ( 'deviceMacAddress' => 'c8:7a:6c:09:eb:33', 'pressure' => '', 'temperature' => '', 'co2' => '20', 'voc' => '10', 'humidity' => '', 'light' => '50', 'pm1' => '', 'pm25' => '', 'pm10' => '', 'timestamp' => 1644917018996, ), 2 => array ( 'deviceMacAddress' => 'c8:7a:6c:09:eb:33', 'pressure' => '', 'temperature' => '', 'co2' => '10', 'voc' => '', 'humidity' => 32, 'light' => '', 'pm1' => '', 'pm25' => '', 'pm10' => '', 'timestamp' => 1644917018997, ), ); $unique = array(); foreach ($finalArray as $value) { $unique[$value['deviceMacAddress']] = $value; } $data = array_values($unique); echo '<pre>'; print_r($data);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/4UHYC
function name:  (null)
number of ops:  18
compiled vars:  !0 = $finalArray, !1 = $unique, !2 = $value, !3 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   47     1        ASSIGN                                                   !1, <array>
   49     2      > FE_RESET_R                                       $6      !0, ->8
          3    > > FE_FETCH_R                                               $6, !2, ->8
   51     4    >   FETCH_DIM_R                                      ~7      !2, 'deviceMacAddress'
          5        ASSIGN_DIM                                               !1, ~7
          6        OP_DATA                                                  !2
   49     7      > JMP                                                      ->3
          8    >   FE_FREE                                                  $6
   54     9        INIT_FCALL                                               'array_values'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $9      
         12        ASSIGN                                                   !3, $9
   55    13        ECHO                                                     '%3Cpre%3E'
   56    14        INIT_FCALL                                               'print_r'
         15        SEND_VAR                                                 !3
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.97 ms | 998 KiB | 15 Q