3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '{"date":"24-03-2014","Cars":["Cheap","Expensive"]}'; $array = json_decode($string, 1); var_dump($array['date']);//string(10) "24-03-2014" $string = '{"date":"24-03-2014","Cars":["Cheap","Expensive"]}'; $obj = json_decode($string); var_dump($obj->date);//string(10) "24-03-2014"
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ig2gm
function name:  (null)
number of ops:  20
compiled vars:  !0 = $string, !1 = $array, !2 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7B%22date%22%3A%2224-03-2014%22%2C%22Cars%22%3A%5B%22Cheap%22%2C%22Expensive%22%5D%7D'
    4     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 1
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
    5     6        INIT_FCALL                                               'var_dump'
          7        FETCH_DIM_R                                      ~6      !1, 'date'
          8        SEND_VAL                                                 ~6
          9        DO_ICALL                                                 
    7    10        ASSIGN                                                   !0, '%7B%22date%22%3A%2224-03-2014%22%2C%22Cars%22%3A%5B%22Cheap%22%2C%22Expensive%22%5D%7D'
    8    11        INIT_FCALL                                               'json_decode'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $9      
         14        ASSIGN                                                   !2, $9
    9    15        INIT_FCALL                                               'var_dump'
         16        FETCH_OBJ_R                                      ~11     !2, 'date'
         17        SEND_VAL                                                 ~11
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.35 ms | 1395 KiB | 17 Q