3v4l.org

run code in 300+ PHP versions simultaneously
<?php $brokenJson = '[{"test":"}]'; $res = json_decode($brokenJson, true); if (json_last_error() != JSON_ERROR_NONE) { throw new Exception(json_last_error_msg(), json_last_error()); } var_dump($res);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 19
Branch analysis from position: 10
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ttU4E
function name:  (null)
number of ops:  23
compiled vars:  !0 = $brokenJson, !1 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%5B%7B%22test%22%3A%22%7D%5D'
    5     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
    7     6        INIT_FCALL                                               'json_last_error'
          7        DO_ICALL                                         $5      
          8        IS_NOT_EQUAL                                             $5, 0
          9      > JMPZ                                                     ~6, ->19
    8    10    >   NEW                                              $7      'Exception'
         11        INIT_FCALL                                               'json_last_error_msg'
         12        DO_ICALL                                         $8      
         13        SEND_VAR_NO_REF_EX                                       $8
         14        INIT_FCALL                                               'json_last_error'
         15        DO_ICALL                                         $9      
         16        SEND_VAR_NO_REF_EX                                       $9
         17        DO_FCALL                                      0          
         18      > THROW                                         0          $7
   11    19    >   INIT_FCALL                                               'var_dump'
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.04 ms | 1386 KiB | 21 Q