3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump('JSON_ERROR_DEPTH' . ' : ' . JSON_ERROR_DEPTH); var_dump('JSON_ERROR_STATE_MISMATCH' . ' : ' . JSON_ERROR_STATE_MISMATCH); var_dump('JSON_ERROR_CTRL_CHAR' . ' : ' . JSON_ERROR_CTRL_CHAR); var_dump('JSON_ERROR_SYNTAX' . ' : ' . JSON_ERROR_SYNTAX); var_dump('JSON_ERROR_UTF8' . ' : ' . JSON_ERROR_UTF8); $a = json_encode('wrong json'); var_dump(json_last_error()); var_dump(json_last_error_msg()); /*switch (json_last_error()) { case JSON_ERROR_DEPTH: $error = 'Maximum stack depth exceeded'; break; case JSON_ERROR_STATE_MISMATCH: $error = 'Underflow or the modes mismatch'; break; case JSON_ERROR_CTRL_CHAR: $error = 'Unexpected control character found'; break; case JSON_ERROR_SYNTAX: $error = 'Syntax error, malformed JSON'; break; case JSON_ERROR_UTF8: $error = 'Malformed UTF-8 characters, possibly incorrectly encoded'; break; default: $error = 'Unknown error'; break; } var_dump($error);*/
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pCdvq
function name:  (null)
number of ops:  30
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'JSON_ERROR_DEPTH+%3A+1'
          2        DO_ICALL                                                 
    4     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAL                                                 'JSON_ERROR_STATE_MISMATCH+%3A+2'
          5        DO_ICALL                                                 
    5     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAL                                                 'JSON_ERROR_CTRL_CHAR+%3A+3'
          8        DO_ICALL                                                 
    6     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAL                                                 'JSON_ERROR_SYNTAX+%3A+4'
         11        DO_ICALL                                                 
    7    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAL                                                 'JSON_ERROR_UTF8+%3A+5'
         14        DO_ICALL                                                 
    9    15        INIT_FCALL                                               'json_encode'
         16        SEND_VAL                                                 'wrong+json'
         17        DO_ICALL                                         $6      
         18        ASSIGN                                                   !0, $6
   10    19        INIT_FCALL                                               'var_dump'
         20        INIT_FCALL                                               'json_last_error'
         21        DO_ICALL                                         $8      
         22        SEND_VAR                                                 $8
         23        DO_ICALL                                                 
   11    24        INIT_FCALL                                               'var_dump'
         25        INIT_FCALL                                               'json_last_error_msg'
         26        DO_ICALL                                         $10     
         27        SEND_VAR                                                 $10
         28        DO_ICALL                                                 
   34    29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.42 ms | 1395 KiB | 21 Q