3v4l.org

run code in 300+ PHP versions simultaneously
<?php foreach([ 'null', 'true', 'false', '"text"', '123', '1E2', '[1,2,3]', '{"foo":"bar"}', ] as $json) { var_dump(json_decode($json, true)); assert(json_last_error() === JSON_ERROR_NONE); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 1, Position 2 = 18
Branch analysis from position: 1
2 jumps found. (Code = 78) Position 1 = 2, Position 2 = 18
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 1
Branch analysis from position: 1
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/ffkRp
function name:  (null)
number of ops:  20
compiled vars:  !0 = $json
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E > > FE_RESET_R                                       $1      <array>, ->18
          1    > > FE_FETCH_R                                               $1, !0, ->18
   13     2    >   INIT_FCALL                                               'var_dump'
          3        INIT_FCALL                                               'json_decode'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                         $2      
          7        SEND_VAR                                                 $2
          8        DO_ICALL                                                 
   14     9        ASSERT_CHECK                                             
         10        INIT_FCALL                                               'assert'
         11        INIT_FCALL                                               'json_last_error'
         12        DO_ICALL                                         $4      
         13        IS_IDENTICAL                                     ~5      $4, 0
         14        SEND_VAL                                                 ~5
         15        SEND_VAL                                                 'assert%28json_last_error%28%29+%3D%3D%3D+JSON_ERROR_NONE%29'
         16        DO_ICALL                                                 
    3    17      > JMP                                                      ->1
         18    >   FE_FREE                                                  $1
   15    19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.27 ms | 1000 KiB | 17 Q