3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = (array) json_decode('{"3":{"friend":45,"all":100},"2":{"friend":30,"all":50},"1":{"friend":25,"all":25}}'); var_dump($a); var_dump($a['3']); var_dump($a["3"]); var_dump($a[(string) 3]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bMdg5
function name:  (null)
number of ops:  22
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'json_decode'
          1        SEND_VAL                                                 '%7B%223%22%3A%7B%22friend%22%3A45%2C%22all%22%3A100%7D%2C%222%22%3A%7B%22friend%22%3A30%2C%22all%22%3A50%7D%2C%221%22%3A%7B%22friend%22%3A25%2C%22all%22%3A25%7D%7D'
          2        DO_ICALL                                         $1      
          3        CAST                                          7  ~2      $1
          4        ASSIGN                                                   !0, ~2
    3     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
    4     8        INIT_FCALL                                               'var_dump'
          9        FETCH_DIM_R                                      ~5      !0, 3
         10        SEND_VAL                                                 ~5
         11        DO_ICALL                                                 
    5    12        INIT_FCALL                                               'var_dump'
         13        FETCH_DIM_R                                      ~7      !0, 3
         14        SEND_VAL                                                 ~7
         15        DO_ICALL                                                 
    6    16        INIT_FCALL                                               'var_dump'
         17        CAST                                          6  ~9      3
         18        FETCH_DIM_R                                      ~10     !0, ~9
         19        SEND_VAL                                                 ~10
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.69 ms | 1395 KiB | 17 Q