3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['in_user_id' => 157, 'st_meta_key' => 'city', 'st_meta_value' => 'jaipur'], ['in_user_id' => 157, 'st_meta_key' => 'latitude'], ['in_user_id' => 157, 'st_meta_key' => 'longitude'], ['in_user_id' => 203, 'st_meta_key' => 'city', 'st_meta_value' => 'Jaipur'], ['in_user_id' => 203, 'st_meta_key' => 'latitude', 'st_meta_value' => '26.8517972'], ['in_user_id' => 203, 'st_meta_key' => 'longitude', 'st_meta_value' => '75.7862232'], ['in_user_id' => 214, 'st_meta_key' => 'city', 'st_meta_value' => 'Jaipur'], ['in_user_id' => 214, 'st_meta_key' => 'latitude', 'st_meta_value' => '26.8517972'], ['in_user_id' => 214, 'st_meta_key' => 'longitude', 'st_meta_value' => '75.7862232'] ]; $result = []; foreach ($array as $row) { $result[$row['in_user_id']][$row['st_meta_key']] = $row['st_meta_value'] ?? ''; } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 13
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/E6aAB
function name:  (null)
number of ops:  18
compiled vars:  !0 = $array, !1 = $result, !2 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   15     1        ASSIGN                                                   !1, <array>
   16     2      > FE_RESET_R                                       $5      !0, ->13
          3    > > FE_FETCH_R                                               $5, !2, ->13
   17     4    >   FETCH_DIM_R                                      ~6      !2, 'in_user_id'
          5        FETCH_DIM_R                                      ~8      !2, 'st_meta_key'
          6        FETCH_DIM_IS                                     ~10     !2, 'st_meta_value'
          7        COALESCE                                         ~11     ~10
          8        QM_ASSIGN                                        ~11     ''
          9        FETCH_DIM_W                                      $7      !1, ~6
         10        ASSIGN_DIM                                               $7, ~8
         11        OP_DATA                                                  ~11
   16    12      > JMP                                                      ->3
         13    >   FE_FREE                                                  $5
   19    14        INIT_FCALL                                               'var_export'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.35 ms | 1004 KiB | 14 Q