3v4l.org

run code in 300+ PHP versions simultaneously
<?php $an_object = new StdClass(); $an_object->attr = 'value'; $encoded = json_encode($an_object); print_r( json_decode($encoded, null, 512, JSON_OBJECT_AS_ARRAY)); print_r( json_decode($encoded, true, 512, JSON_OBJECT_AS_ARRAY)); print_r( json_decode($encoded, false, 512, JSON_OBJECT_AS_ARRAY));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/b1mA6
function name:  (null)
number of ops:  37
compiled vars:  !0 = $an_object, !1 = $encoded
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $2      'StdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    4     3        ASSIGN_OBJ                                               !0, 'attr'
          4        OP_DATA                                                  'value'
    6     5        INIT_FCALL                                               'json_encode'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $6      
          8        ASSIGN                                                   !1, $6
    7     9        INIT_FCALL                                               'print_r'
    8    10        INIT_FCALL                                               'json_decode'
         11        SEND_VAR                                                 !1
         12        SEND_VAL                                                 null
         13        SEND_VAL                                                 512
         14        SEND_VAL                                                 1
         15        DO_ICALL                                         $8      
         16        SEND_VAR                                                 $8
    7    17        DO_ICALL                                                 
    9    18        INIT_FCALL                                               'print_r'
   10    19        INIT_FCALL                                               'json_decode'
         20        SEND_VAR                                                 !1
         21        SEND_VAL                                                 <true>
         22        SEND_VAL                                                 512
         23        SEND_VAL                                                 1
         24        DO_ICALL                                         $10     
         25        SEND_VAR                                                 $10
    9    26        DO_ICALL                                                 
   11    27        INIT_FCALL                                               'print_r'
   12    28        INIT_FCALL                                               'json_decode'
         29        SEND_VAR                                                 !1
         30        SEND_VAL                                                 <false>
         31        SEND_VAL                                                 512
         32        SEND_VAL                                                 1
         33        DO_ICALL                                         $12     
         34        SEND_VAR                                                 $12
   11    35        DO_ICALL                                                 
   12    36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.86 ms | 1448 KiB | 16 Q