3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.03 ms | 1448 KiB | 16 Q