3v4l.org

run code in 500+ PHP versions simultaneously
<?php $cart_array = json_decode('{ "items":[ { "count":"1", "cart_id":123, "plu":"TP16", "description":"Bag" }, { "count":1, "cart_id":1234, "plu":"DISCT10", "description":"10% Discount" } ], "total":9.9, "discount_total":9.9 }', true); $cart_array['items'] = array_column($cart_array['items'], NULL, 'cart_id'); Var_dump($cart_array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cPD5n
function name:  (null)
number of ops:  17
compiled vars:  !0 = $cart_array
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                                   'json_decode'
          1        SEND_VAL                                                     '%7B++%0A+++%22items%22%3A%5B++%0A++++++%7B++%0A+++++++++%22count%22%3A%221%22%2C%0A+++++++++%22cart_id%22%3A123%2C%0A+++++++++%22plu%22%3A%22TP16%22%2C%0A+++++++++%22description%22%3A%22Bag%22%0A%0A++++++%7D%2C%0A++++++%7B++%0A+++++++++%22count%22%3A1%2C%0A+++++++++%22cart_id%22%3A1234%2C%0A+++++++++%22plu%22%3A%22DISCT10%22%2C%0A+++++++++%22description%22%3A%2210%25+Discount%22%0A%0A++++++%7D%0A+++%5D%2C%0A+++%22total%22%3A9.9%2C%0A+++%22discount_total%22%3A9.9%0A%7D'
   22     2        SEND_VAL                                                     <true>
    3     3        DO_ICALL                                             $1      
          4        ASSIGN                                                       !0, $1
   24     5        INIT_FCALL                                                   'array_column'
          6        FETCH_DIM_R                                          ~4      !0, 'items'
          7        SEND_VAL                                                     ~4
          8        SEND_VAL                                                     null
          9        SEND_VAL                                                     'cart_id'
         10        DO_ICALL                                             $5      
         11        ASSIGN_DIM                                                   !0, 'items'
         12        OP_DATA                                                      $5
   25    13        INIT_FCALL                                                   'var_dump'
         14        SEND_VAR                                                     !0
         15        DO_ICALL                                                     
         16      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
214.78 ms | 2167 KiB | 16 Q