3v4l.org

run code in 300+ PHP versions simultaneously
<?php $names = preg_grep('/^JSON_ERROR/', array_keys(get_defined_constants())); $errors = array_combine(array_map("constant", $names), $names); var_dump(json_decode('{"":123}'), $errors[json_last_error()]); var_dump(json_decode(""), $errors[json_last_error()]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ef1ut
function name:  (null)
number of ops:  40
compiled vars:  !0 = $names, !1 = $errors
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'preg_grep'
          1        SEND_VAL                                                 '%2F%5EJSON_ERROR%2F'
          2        INIT_FCALL                                               'array_keys'
          3        INIT_FCALL                                               'get_defined_constants'
          4        DO_ICALL                                         $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                         $3      
          7        SEND_VAR                                                 $3
          8        DO_ICALL                                         $4      
          9        ASSIGN                                                   !0, $4
    4    10        INIT_FCALL                                               'array_combine'
         11        INIT_FCALL                                               'array_map'
         12        SEND_VAL                                                 'constant'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $6      
         15        SEND_VAR                                                 $6
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                         $7      
         18        ASSIGN                                                   !1, $7
    6    19        INIT_FCALL                                               'var_dump'
         20        INIT_FCALL                                               'json_decode'
         21        SEND_VAL                                                 '%7B%22%22%3A123%7D'
         22        DO_ICALL                                         $9      
         23        SEND_VAR                                                 $9
         24        INIT_FCALL                                               'json_last_error'
         25        DO_ICALL                                         $10     
         26        FETCH_DIM_R                                      ~11     !1, $10
         27        SEND_VAL                                                 ~11
         28        DO_ICALL                                                 
    7    29        INIT_FCALL                                               'var_dump'
         30        INIT_FCALL                                               'json_decode'
         31        SEND_VAL                                                 ''
         32        DO_ICALL                                         $13     
         33        SEND_VAR                                                 $13
         34        INIT_FCALL                                               'json_last_error'
         35        DO_ICALL                                         $14     
         36        FETCH_DIM_R                                      ~15     !1, $14
         37        SEND_VAL                                                 ~15
         38        DO_ICALL                                                 
         39      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.99 ms | 1396 KiB | 29 Q