3v4l.org

run code in 300+ PHP versions simultaneously
<?php $val = '{"searchform":null}, null, {"searchresults":"foo"}'; var_dump(json_decode($val)); var_dump(json_last_error()); var_dump(PHP_VERSION_ID >= 50500 ? json_last_error_msg() : NULL);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 18
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uXlo3
function name:  (null)
number of ops:  22
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%7B%22searchform%22%3Anull%7D%2C+null%2C+%7B%22searchresults%22%3A%22foo%22%7D'
    3     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'json_decode'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
    4     7        INIT_FCALL                                               'var_dump'
          8        INIT_FCALL                                               'json_last_error'
          9        DO_ICALL                                         $4      
         10        SEND_VAR                                                 $4
         11        DO_ICALL                                                 
    5    12        INIT_FCALL                                               'var_dump'
         13      > JMPZ                                                     <true>, ->18
         14    >   INIT_FCALL                                               'json_last_error_msg'
         15        DO_ICALL                                         $6      
         16        QM_ASSIGN                                        ~7      $6
         17      > JMP                                                      ->19
         18    >   QM_ASSIGN                                        ~7      null
         19    >   SEND_VAL                                                 ~7
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.19 ms | 1395 KiB | 21 Q