3v4l.org

run code in 300+ PHP versions simultaneously
<?php function guzzle_json_decode($json, $assoc = false, $depth = 512, $options = 0) { $data = \json_decode($json, $assoc, $depth, $options); if (JSON_ERROR_NONE !== json_last_error()) { throw new \InvalidArgumentException( 'json_decode error: ' . json_last_error_msg() ); } return $data; } $json = json_encode(""); var_dump(guzzle_json_decode("", true)); var_dump(json_last_error());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KuPCU
function name:  (null)
number of ops:  17
compiled vars:  !0 = $json
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'json_encode'
          1        SEND_VAL                                                 ''
          2        DO_ICALL                                         $1      
          3        ASSIGN                                                   !0, $1
   17     4        INIT_FCALL                                               'var_dump'
          5        INIT_FCALL                                               'guzzle_json_decode'
          6        SEND_VAL                                                 ''
          7        SEND_VAL                                                 <true>
          8        DO_FCALL                                      0  $3      
          9        SEND_VAR                                                 $3
         10        DO_ICALL                                                 
   18    11        INIT_FCALL                                               'var_dump'
         12        INIT_FCALL                                               'json_last_error'
         13        DO_ICALL                                         $5      
         14        SEND_VAR                                                 $5
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Function guzzle_json_decode:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 22
Branch analysis from position: 15
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KuPCU
function name:  guzzle_json_decode
number of ops:  24
compiled vars:  !0 = $json, !1 = $assoc, !2 = $depth, !3 = $options, !4 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <false>
          2        RECV_INIT                                        !2      512
          3        RECV_INIT                                        !3      0
    5     4        INIT_FCALL                                               'json_decode'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !1
          7        SEND_VAR                                                 !2
          8        SEND_VAR                                                 !3
          9        DO_ICALL                                         $5      
         10        ASSIGN                                                   !4, $5
    6    11        INIT_FCALL                                               'json_last_error'
         12        DO_ICALL                                         $7      
         13        IS_NOT_IDENTICAL                                         $7, 0
         14      > JMPZ                                                     ~8, ->22
    7    15    >   NEW                                              $9      'InvalidArgumentException'
    8    16        INIT_FCALL                                               'json_last_error_msg'
         17        DO_ICALL                                         $10     
         18        CONCAT                                           ~11     'json_decode+error%3A+', $10
         19        SEND_VAL_EX                                              ~11
         20        DO_FCALL                                      0          
         21      > THROW                                         0          $9
   12    22    > > RETURN                                                   !4
   13    23*     > RETURN                                                   null

End of function guzzle_json_decode

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.49 ms | 1403 KiB | 24 Q