3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{ "status" : "success", "data" : { "items" : [ { "market_hash_name" : "AK-47 | Redline (Field-Tested)", "total_items" : 923, "lowest_price" : "4.00", "highest_price" : "300.00", "cumulative_price" : "8722.77", "recent_sales_info" : { "hours" : "18.07", "average_price" : "4.21" } }, { "market_hash_name" : "AK-47 | Redline (Minimal Wear)", "total_items" : 51, "lowest_price" : "14.26", "highest_price" : "100.00", "cumulative_price" : "1089.71", "recent_sales_info" : { "hours" : "23.37", "average_price" : "14.36" } } ] } }'; $result = json_decode ($json); foreach($result->data->items as $val){ if($val->market_hash_name == "AK-47 | Redline (Field-Tested)") echo "Total Item: ".$val->total_items." AND Avg Price:".$val->recent_sales_info->average_price; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 20
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 20
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 19
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 19
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/Nkdrb
function name:  (null)
number of ops:  22
compiled vars:  !0 = $json, !1 = $result, !2 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7B%0A++%22status%22+%3A+%22success%22%2C%0A++%22data%22+%3A+%7B%0A++++%22items%22+%3A+%5B%0A++++++%7B%0A++++++++%22market_hash_name%22+%3A+%22AK-47+%7C+Redline+%28Field-Tested%29%22%2C%0A++++++++%22total_items%22+%3A+923%2C%0A++++++++%22lowest_price%22+%3A+%224.00%22%2C%0A++++++++%22highest_price%22+%3A+%22300.00%22%2C%0A++++++++%22cumulative_price%22+%3A+%228722.77%22%2C%0A++++++++%22recent_sales_info%22+%3A+%7B%0A++++++++++%22hours%22+%3A+%2218.07%22%2C%0A++++++++++%22average_price%22+%3A+%224.21%22%0A++++++++%7D%0A++++++%7D%2C%0A++++++%7B%0A++++++++%22market_hash_name%22+%3A+%22AK-47+%7C+Redline+%28Minimal+Wear%29%22%2C%0A++++++++%22total_items%22+%3A+51%2C%0A++++++++%22lowest_price%22+%3A+%2214.26%22%2C%0A++++++++%22highest_price%22+%3A+%22100.00%22%2C%0A++++++++%22cumulative_price%22+%3A+%221089.71%22%2C%0A++++++++%22recent_sales_info%22+%3A+%7B%0A++++++++++%22hours%22+%3A+%2223.37%22%2C%0A++++++++++%22average_price%22+%3A+%2214.36%22%0A++++++++%7D%0A++++++%7D%0A++++%5D%0A++%7D%0A%7D'
   32     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !1, $4
   34     5        FETCH_OBJ_R                                      ~6      !1, 'data'
          6        FETCH_OBJ_R                                      ~7      ~6, 'items'
          7      > FE_RESET_R                                       $8      ~7, ->20
          8    > > FE_FETCH_R                                               $8, !2, ->20
   35     9    >   FETCH_OBJ_R                                      ~9      !2, 'market_hash_name'
         10        IS_EQUAL                                                 ~9, 'AK-47+%7C+Redline+%28Field-Tested%29'
         11      > JMPZ                                                     ~10, ->19
   36    12    >   FETCH_OBJ_R                                      ~11     !2, 'total_items'
         13        CONCAT                                           ~12     'Total+Item%3A+', ~11
         14        CONCAT                                           ~13     ~12, '+AND+Avg+Price%3A'
         15        FETCH_OBJ_R                                      ~14     !2, 'recent_sales_info'
         16        FETCH_OBJ_R                                      ~15     ~14, 'average_price'
         17        CONCAT                                           ~16     ~13, ~15
         18        ECHO                                                     ~16
   34    19    > > JMP                                                      ->8
         20    >   FE_FREE                                                  $8
   37    21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
135.9 ms | 1001 KiB | 14 Q