3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isJson($string) { json_decode($string); return (json_last_error() == JSON_ERROR_NONE); } $a=['arraiii'=>['dentro'=>234]]; var_dump(isJson($a));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/80SOE
function name:  (null)
number of ops:  8
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                   !0, <array>
   14     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'isjson'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function isjson:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/80SOE
function name:  isJson
number of ops:  9
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    7     4        INIT_FCALL                                               'json_last_error'
          5        DO_ICALL                                         $2      
          6        IS_EQUAL                                         ~3      $2, 0
          7      > RETURN                                                   ~3
    8     8*     > RETURN                                                   null

End of function isjson

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.45 ms | 1397 KiB | 20 Q