3v4l.org

run code in 300+ PHP versions simultaneously
<?php // depth 1 $a = new \stdClass(); // depth 2 $b = new \stdClass(); $b->x = $a; // depth 3 $c = new \stdClass(); $c->x = [$a]; var_export(json_encode($a, 0, 0)); echo "\n"; var_export(json_encode($b, 0, 1)); echo "\n"; var_export(json_encode($c, 0, 2));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DoG4A
function name:  (null)
number of ops:  41
compiled vars:  !0 = $a, !1 = $b, !2 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   NEW                                              $3      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    7     3        NEW                                              $6      'stdClass'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $6
    8     6        ASSIGN_OBJ                                               !1, 'x'
          7        OP_DATA                                                  !0
   11     8        NEW                                              $10     'stdClass'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $10
   12    11        INIT_ARRAY                                       ~14     !0
         12        ASSIGN_OBJ                                               !2, 'x'
         13        OP_DATA                                                  ~14
   14    14        INIT_FCALL                                               'var_export'
         15        INIT_FCALL                                               'json_encode'
         16        SEND_VAR                                                 !0
         17        SEND_VAL                                                 0
         18        SEND_VAL                                                 0
         19        DO_ICALL                                         $15     
         20        SEND_VAR                                                 $15
         21        DO_ICALL                                                 
         22        ECHO                                                     '%0A'
   15    23        INIT_FCALL                                               'var_export'
         24        INIT_FCALL                                               'json_encode'
         25        SEND_VAR                                                 !1
         26        SEND_VAL                                                 0
         27        SEND_VAL                                                 1
         28        DO_ICALL                                         $17     
         29        SEND_VAR                                                 $17
         30        DO_ICALL                                                 
         31        ECHO                                                     '%0A'
   16    32        INIT_FCALL                                               'var_export'
         33        INIT_FCALL                                               'json_encode'
         34        SEND_VAR                                                 !2
         35        SEND_VAL                                                 0
         36        SEND_VAL                                                 2
         37        DO_ICALL                                         $19     
         38        SEND_VAR                                                 $19
         39        DO_ICALL                                                 
         40      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.77 ms | 1396 KiB | 17 Q