3v4l.org

run code in 300+ PHP versions simultaneously
<?php $brokenJson = '[{"test":"}]'; $res = json_decode($brokenJson, true); if (json_last_error() != JSON_ERROR_NONE) { die(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 = 17
Branch analysis from position: 10
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P0S3i
function name:  (null)
number of ops:  21
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, ->17
    8    10    >   INIT_FCALL                                               'json_last_error_msg'
         11        DO_ICALL                                         $7      
         12        CONCAT                                           ~8      $7, '+-+'
         13        INIT_FCALL                                               'json_last_error'
         14        DO_ICALL                                         $9      
         15        CONCAT                                           ~10     ~8, $9
         16      > EXIT                                                     ~10
   11    17    >   INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.72 ms | 1395 KiB | 21 Q