3v4l.org

run code in 500+ PHP versions simultaneously
<?php // depth 1 $a = []; // 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/vFgh0
function name:  (null)
number of ops:  39
compiled vars:  !0 = $a, !1 = $b, !2 = $c
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                       !0, <array>
    7     1        NEW                                                  $4      'stdClass'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !1, $4
    8     4        ASSIGN_OBJ                                                   !1, 'x'
          5        OP_DATA                                                      !0
   11     6        NEW                                                  $8      'stdClass'
          7        DO_FCALL                                          0          
          8        ASSIGN                                                       !2, $8
   12     9        INIT_ARRAY                                           ~12     !0
         10        ASSIGN_OBJ                                                   !2, 'x'
         11        OP_DATA                                                      ~12
   14    12        INIT_FCALL                                                   'var_export'
         13        INIT_FCALL                                                   'json_encode'
         14        SEND_VAR                                                     !0
         15        SEND_VAL                                                     0
         16        SEND_VAL                                                     0
         17        DO_ICALL                                             $13     
         18        SEND_VAR                                                     $13
         19        DO_ICALL                                                     
         20        ECHO                                                         '%0A'
   15    21        INIT_FCALL                                                   'var_export'
         22        INIT_FCALL                                                   'json_encode'
         23        SEND_VAR                                                     !1
         24        SEND_VAL                                                     0
         25        SEND_VAL                                                     1
         26        DO_ICALL                                             $15     
         27        SEND_VAR                                                     $15
         28        DO_ICALL                                                     
         29        ECHO                                                         '%0A'
   16    30        INIT_FCALL                                                   'var_export'
         31        INIT_FCALL                                                   'json_encode'
         32        SEND_VAR                                                     !2
         33        SEND_VAL                                                     0
         34        SEND_VAL                                                     2
         35        DO_ICALL                                             $17     
         36        SEND_VAR                                                     $17
         37        DO_ICALL                                                     
         38      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
150.78 ms | 1996 KiB | 15 Q