3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array( 'C' ); for ( $i = 0; $i < 1000; $i++ ) { $a = array( 'A', $a, 'B' ); } echo "AAA\n"; var_dump( json_encode( $a, JSON_PARTIAL_OUTPUT_ON_ERROR ) ); echo "BBB\n"; var_dump( json_last_error() ); json_encode( 'foo' ); echo "CCC\n"; var_dump( json_encode( $a, 0, 10 ) ); echo "DDD\n"; var_dump( json_last_error() );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
Branch analysis from position: 3
filename:       /in/Oc6PS
function name:  (null)
number of ops:  43
compiled vars:  !0 = $a, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->8
    5     3    >   INIT_ARRAY                                       ~4      'A'
          4        ADD_ARRAY_ELEMENT                                ~4      !0
          5        ADD_ARRAY_ELEMENT                                ~4      'B'
          6        ASSIGN                                                   !0, ~4
    4     7        PRE_INC                                                  !1
          8    >   IS_SMALLER                                               !1, 1000
          9      > JMPNZ                                                    ~7, ->3
    8    10    >   ECHO                                                     'AAA%0A'
    9    11        INIT_FCALL                                               'var_dump'
         12        INIT_FCALL                                               'json_encode'
         13        SEND_VAR                                                 !0
         14        SEND_VAL                                                 512
         15        DO_ICALL                                         $8      
         16        SEND_VAR                                                 $8
         17        DO_ICALL                                                 
   10    18        ECHO                                                     'BBB%0A'
   11    19        INIT_FCALL                                               'var_dump'
         20        INIT_FCALL                                               'json_last_error'
         21        DO_ICALL                                         $10     
         22        SEND_VAR                                                 $10
         23        DO_ICALL                                                 
   12    24        INIT_FCALL                                               'json_encode'
         25        SEND_VAL                                                 'foo'
         26        DO_ICALL                                                 
   13    27        ECHO                                                     'CCC%0A'
   14    28        INIT_FCALL                                               'var_dump'
         29        INIT_FCALL                                               'json_encode'
         30        SEND_VAR                                                 !0
         31        SEND_VAL                                                 0
         32        SEND_VAL                                                 10
         33        DO_ICALL                                         $13     
         34        SEND_VAR                                                 $13
         35        DO_ICALL                                                 
   15    36        ECHO                                                     'DDD%0A'
   16    37        INIT_FCALL                                               'var_dump'
         38        INIT_FCALL                                               'json_last_error'
         39        DO_ICALL                                         $15     
         40        SEND_VAR                                                 $15
         41        DO_ICALL                                                 
         42      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.99 ms | 1400 KiB | 19 Q