3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
189.44 ms | 1399 KiB | 17 Q