3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '[]'; for ($i = 0; $i < 50000; $i++) $string = '[' . $string . ']'; $s = microtime(true); json_decode($string); $s = microtime(true) - $s; var_dump(json_last_error(), JSON_ERROR_DEPTH, round($s, 5));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 3
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 3
Branch analysis from position: 9
Branch analysis from position: 3
filename:       /in/5bM95
function name:  (null)
number of ops:  33
compiled vars:  !0 = $string, !1 = $i, !2 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%5B%5D'
    5     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->7
    6     3    >   CONCAT                                           ~5      '%5B', !0
          4        CONCAT                                           ~6      ~5, '%5D'
          5        ASSIGN                                                   !0, ~6
    5     6        PRE_INC                                                  !1
          7    >   IS_SMALLER                                               !1, 50000
          8      > JMPNZ                                                    ~9, ->3
    8     9    >   INIT_FCALL                                               'microtime'
         10        SEND_VAL                                                 <true>
         11        DO_ICALL                                         $10     
         12        ASSIGN                                                   !2, $10
    9    13        INIT_FCALL                                               'json_decode'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                                 
   10    16        INIT_FCALL                                               'microtime'
         17        SEND_VAL                                                 <true>
         18        DO_ICALL                                         $13     
         19        SUB                                              ~14     $13, !2
         20        ASSIGN                                                   !2, ~14
   12    21        INIT_FCALL                                               'var_dump'
         22        INIT_FCALL                                               'json_last_error'
         23        DO_ICALL                                         $16     
         24        SEND_VAR                                                 $16
         25        SEND_VAL                                                 1
         26        INIT_FCALL                                               'round'
         27        SEND_VAR                                                 !2
         28        SEND_VAL                                                 5
         29        DO_ICALL                                         $17     
         30        SEND_VAR                                                 $17
         31        DO_ICALL                                                 
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.64 ms | 1396 KiB | 23 Q