3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array(); $a[0] =& $a; $b = array( &$a ); var_dump( json_encode( $b, 0, -1 ) ); var_dump( json_last_error() ); var_dump( json_encode( $b, 0, 0 ) ); var_dump( json_last_error() ); var_dump( json_encode( $b, 0, 1 ) ); var_dump( json_last_error() ); var_dump( json_encode( $b, 0, 2 ) ); var_dump( json_last_error() ); var_dump( json_encode( $b, 0, 3 ) ); var_dump( json_last_error() );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0WSt9
function name:  (null)
number of ops:  71
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        FETCH_DIM_W                                      $3      !0, 0
          2        ASSIGN_REF                                               $3, !0
    5     3        INIT_ARRAY                                       ~5      !0
          4        ASSIGN                                                   !1, ~5
    7     5        INIT_FCALL                                               'var_dump'
          6        INIT_FCALL                                               'json_encode'
          7        SEND_VAR                                                 !1
          8        SEND_VAL                                                 0
          9        SEND_VAL                                                 -1
         10        DO_ICALL                                         $7      
         11        SEND_VAR                                                 $7
         12        DO_ICALL                                                 
    8    13        INIT_FCALL                                               'var_dump'
         14        INIT_FCALL                                               'json_last_error'
         15        DO_ICALL                                         $9      
         16        SEND_VAR                                                 $9
         17        DO_ICALL                                                 
    9    18        INIT_FCALL                                               'var_dump'
         19        INIT_FCALL                                               'json_encode'
         20        SEND_VAR                                                 !1
         21        SEND_VAL                                                 0
         22        SEND_VAL                                                 0
         23        DO_ICALL                                         $11     
         24        SEND_VAR                                                 $11
         25        DO_ICALL                                                 
   10    26        INIT_FCALL                                               'var_dump'
         27        INIT_FCALL                                               'json_last_error'
         28        DO_ICALL                                         $13     
         29        SEND_VAR                                                 $13
         30        DO_ICALL                                                 
   11    31        INIT_FCALL                                               'var_dump'
         32        INIT_FCALL                                               'json_encode'
         33        SEND_VAR                                                 !1
         34        SEND_VAL                                                 0
         35        SEND_VAL                                                 1
         36        DO_ICALL                                         $15     
         37        SEND_VAR                                                 $15
         38        DO_ICALL                                                 
   12    39        INIT_FCALL                                               'var_dump'
         40        INIT_FCALL                                               'json_last_error'
         41        DO_ICALL                                         $17     
         42        SEND_VAR                                                 $17
         43        DO_ICALL                                                 
   13    44        INIT_FCALL                                               'var_dump'
         45        INIT_FCALL                                               'json_encode'
         46        SEND_VAR                                                 !1
         47        SEND_VAL                                                 0
         48        SEND_VAL                                                 2
         49        DO_ICALL                                         $19     
         50        SEND_VAR                                                 $19
         51        DO_ICALL                                                 
   14    52        INIT_FCALL                                               'var_dump'
         53        INIT_FCALL                                               'json_last_error'
         54        DO_ICALL                                         $21     
         55        SEND_VAR                                                 $21
         56        DO_ICALL                                                 
   15    57        INIT_FCALL                                               'var_dump'
         58        INIT_FCALL                                               'json_encode'
         59        SEND_VAR                                                 !1
         60        SEND_VAL                                                 0
         61        SEND_VAL                                                 3
         62        DO_ICALL                                         $23     
         63        SEND_VAR                                                 $23
         64        DO_ICALL                                                 
   16    65        INIT_FCALL                                               'var_dump'
         66        INIT_FCALL                                               'json_last_error'
         67        DO_ICALL                                         $25     
         68        SEND_VAR                                                 $25
         69        DO_ICALL                                                 
         70      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.08 ms | 1400 KiB | 19 Q