3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.64 ms | 1400 KiB | 19 Q