3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{"str":true,"123":true}'; $arr1 = json_decode($json, true); $arr2 = (array)json_decode($json); var_export($arr1, $arr2); var_dump(isset($arr1['str']), isset($arr1['123']), isset($arr2['str']), isset($arr2['123']));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sLHGk
function name:  (null)
number of ops:  26
compiled vars:  !0 = $json, !1 = $arr1, !2 = $arr2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7B%22str%22%3Atrue%2C%22123%22%3Atrue%7D'
    5     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
    6     6        INIT_FCALL                                               'json_decode'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $6      
          9        CAST                                          7  ~7      $6
         10        ASSIGN                                                   !2, ~7
    8    11        INIT_FCALL                                               'var_export'
         12        SEND_VAR                                                 !1
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                                 
   10    15        INIT_FCALL                                               'var_dump'
         16        ISSET_ISEMPTY_DIM_OBJ                         0  ~10     !1, 'str'
         17        SEND_VAL                                                 ~10
         18        ISSET_ISEMPTY_DIM_OBJ                         0  ~11     !1, 123
         19        SEND_VAL                                                 ~11
         20        ISSET_ISEMPTY_DIM_OBJ                         0  ~12     !2, 'str'
         21        SEND_VAL                                                 ~12
         22        ISSET_ISEMPTY_DIM_OBJ                         0  ~13     !2, 123
         23        SEND_VAL                                                 ~13
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.35 ms | 1395 KiB | 19 Q