3v4l.org

run code in 500+ PHP versions simultaneously
<?php if (!function_exists('json_last_error_msg')) { function json_last_error_msg() { static $errors = array( JSON_ERROR_NONE => null, JSON_ERROR_DEPTH => 'Maximum stack depth exceeded', JSON_ERROR_STATE_MISMATCH => 'Underflow or the modes mismatch', JSON_ERROR_CTRL_CHAR => 'Unexpected control character found', JSON_ERROR_SYNTAX => 'Syntax error, malformed JSON', JSON_ERROR_UTF8 => 'Malformed UTF-8 characters, possibly incorrectly encoded' ); $error = json_last_error(); return array_key_exists($error, $errors) ? $errors[$error] : "Unknown error ({$error})"; } } echo json_decode("2014-06-06"); echo json_last_error_msg(); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/HuGvq
function name:  (null)
number of ops:  14
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                                   'function_exists'
          1        SEND_VAL                                                     'json_last_error_msg'
          2        DO_ICALL                                             $0      
          3        BOOL_NOT                                             ~1      $0
          4      > JMPZ                                                         ~1, ->6
    4     5    >   DECLARE_FUNCTION                                             'json_last_error_msg'
   18     6    >   INIT_FCALL                                                   'json_decode'
          7        SEND_VAL                                                     '2014-06-06'
          8        DO_ICALL                                             $2      
          9        ECHO                                                         $2
   19    10        INIT_FCALL                                                   'json_last_error_msg'
         11        DO_ICALL                                             $3      
         12        ECHO                                                         $3
   20    13      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HuGvq
function name:  json_last_error_msg
number of ops:  15
compiled vars:  !0 = $errors, !1 = $error
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   BIND_STATIC                                                  !0
   13     1        INIT_FCALL                                                   'json_last_error'
          2        DO_ICALL                                             $2      
          3        ASSIGN                                                       !1, $2
   14     4        ARRAY_KEY_EXISTS                                             !1, !0
          5      > JMPZ                                                         ~4, ->9
          6    >   FETCH_DIM_R                                          ~5      !0, !1
          7        QM_ASSIGN                                            ~6      ~5
          8      > JMP                                                          ->13
          9    >   ROPE_INIT                                         3  ~8      'Unknown+error+%28'
         10        ROPE_ADD                                          1  ~8      ~8, !1
         11        ROPE_END                                          2  ~7      ~8, '%29'
         12        QM_ASSIGN                                            ~6      ~7
         13    > > RETURN                                                       ~6
   15    14*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
171.8 ms | 2766 KiB | 17 Q