3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.7 ms | 1400 KiB | 17 Q