3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = ' [ { timestamp: 1509523044, tid: 83450451, price: "6381.0", amount: "1.0", type: "sell" }, { timestamp: 1509523044, tid: 83450448, price: "6380.0", amount: "1.12894377", type: "buy" } ]'; $json = json_decode(preg_replace('/(\w+):/', '"$1":', $str)); Echo $json[0]->price; Var_dump($json);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MMTvm
function name:  (null)
number of ops:  17
compiled vars:  !0 = $str, !1 = $json
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '+%5B%0A++++%7B%0A++++timestamp%3A+1509523044%2C%0A++++tid%3A+83450451%2C%0A++++price%3A+%226381.0%22%2C%0A++++amount%3A+%221.0%22%2C%0A++++type%3A+%22sell%22%0A++++%7D%2C%0A++++%7B%0A++++timestamp%3A+1509523044%2C%0A++++tid%3A+83450448%2C%0A++++price%3A+%226380.0%22%2C%0A++++amount%3A+%221.12894377%22%2C%0A++++type%3A+%22buy%22%0A++++%7D%0A+%5D'
   21     1        INIT_FCALL                                               'json_decode'
          2        INIT_FCALL                                               'preg_replace'
          3        SEND_VAL                                                 '%2F%28%5Cw%2B%29%3A%2F'
          4        SEND_VAL                                                 '%22%241%22%3A'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
          7        SEND_VAR                                                 $3
          8        DO_ICALL                                         $4      
          9        ASSIGN                                                   !1, $4
   22    10        FETCH_DIM_R                                      ~6      !1, 0
         11        FETCH_OBJ_R                                      ~7      ~6, 'price'
         12        ECHO                                                     ~7
   23    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.47 ms | 1399 KiB | 19 Q