3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['x' => 0.5, 'y' => 23], ['x' => 23, 'y' => 21.75], ['x' => 14.25, 'y' => 21.875], ['x' => 19.375, 'y' => 21.75], ['x' => 9.125, 'y' => 21.875], ['x' => 23, 'y' => 19.625], ['x' => 19.375, 'y' => 19.625], ]; foreach ($array as $row) { $result['#' . $row['y']] ??= $row; } var_export(array_values($result));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 15
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/BV0FS
function name:  (null)
number of ops:  23
compiled vars:  !0 = $array, !1 = $row, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   12     1      > FE_RESET_R                                       $4      !0, ->15
          2    > > FE_FETCH_R                                               $4, !1, ->15
   13     3    >   FETCH_DIM_R                                      ~5      !1, 'y'
          4        CONCAT                                           ~6      '%23', ~5
          5        COPY_TMP                                         ~7      ~6
          6        FETCH_DIM_IS                                     ~8      !2, ~6
          7        COALESCE                                         ~9      ~8
          8        ASSIGN_DIM                                       ~10     !2, ~7
          9        OP_DATA                                                  !1
         10        QM_ASSIGN                                        ~9      ~10
         11      > JMP                                                      ->13
         12*       FREE                                                     ~7
         13    >   FREE                                                     ~9
   12    14      > JMP                                                      ->2
         15    >   FE_FREE                                                  $4
   15    16        INIT_FCALL                                               'var_export'
         17        INIT_FCALL                                               'array_values'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                         $11     
         20        SEND_VAR                                                 $11
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
212.18 ms | 1001 KiB | 15 Q