3v4l.org

run code in 300+ PHP versions simultaneously
<?php $response = [ 'success' => 1, 'return' => [ 'sellorders' => [ [ 'sellprice' => 0.00000059, 'quantity' => 1076.00000000, 'total' => 0.00063484, ], [ 'sellprice' => 0.00000060, 'quantity' => 927.41519000, 'total' => 0.00055645, ], ], 'buyorders' => [ [ 'buyprice' => 0.00000058, 'quantity' => 6535.77328102, 'total' => 0.00379075, ], [ 'buyprice' => 0.00000057, 'quantity' => 118539.39620414, 'total' => 0.06756746, ], ], ], ]; $result = []; foreach ($response['return'] as $orders) { foreach ($orders as $item) { $result[] = [ 'sellprice' => $item['sellprice'] ?? $item['buyprice'], 'sellquantity' => $item['quantity'], 'selltotal' => $item['total'], ]; } } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 21
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 21
Branch analysis from position: 5
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 19
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 19
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 19
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/psKeB
function name:  (null)
number of ops:  26
compiled vars:  !0 = $response, !1 = $result, !2 = $orders, !3 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   33     1        ASSIGN                                                   !1, <array>
   34     2        FETCH_DIM_R                                      ~6      !0, 'return'
          3      > FE_RESET_R                                       $7      ~6, ->21
          4    > > FE_FETCH_R                                               $7, !2, ->21
   35     5    > > FE_RESET_R                                       $8      !2, ->19
          6    > > FE_FETCH_R                                               $8, !3, ->19
   37     7    >   FETCH_DIM_IS                                     ~10     !3, 'sellprice'
          8        COALESCE                                         ~11     ~10
          9        FETCH_DIM_R                                      ~12     !3, 'buyprice'
         10        QM_ASSIGN                                        ~11     ~12
         11        INIT_ARRAY                                       ~13     ~11, 'sellprice'
   38    12        FETCH_DIM_R                                      ~14     !3, 'quantity'
         13        ADD_ARRAY_ELEMENT                                ~13     ~14, 'sellquantity'
   39    14        FETCH_DIM_R                                      ~15     !3, 'total'
         15        ADD_ARRAY_ELEMENT                                ~13     ~15, 'selltotal'
   36    16        ASSIGN_DIM                                               !1
   39    17        OP_DATA                                                  ~13
   35    18      > JMP                                                      ->6
         19    >   FE_FREE                                                  $8
   34    20      > JMP                                                      ->4
         21    >   FE_FREE                                                  $7
   43    22        INIT_FCALL                                               'var_export'
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.34 ms | 1006 KiB | 14 Q