3v4l.org

run code in 300+ PHP versions simultaneously
<?php // the name and value must be enclosed in double quotes // single quotes are not valid $bad_json = "{ 'bar': 'baz' }"; echo "BAD:"; json_decode($bad_json); // null $good_json = '{"foo-bar": 12345}'; echo "\nGOOD"; json_decode($good_json);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tqT8j
function name:  (null)
number of ops:  11
compiled vars:  !0 = $bad_json, !1 = $good_json
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, '%7B+%27bar%27%3A+%27baz%27+%7D'
    6     1        ECHO                                                     'BAD%3A'
    7     2        INIT_FCALL                                               'json_decode'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
    9     5        ASSIGN                                                   !1, '%7B%22foo-bar%22%3A+12345%7D'
   10     6        ECHO                                                     '%0AGOOD'
   11     7        INIT_FCALL                                               'json_decode'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.76 ms | 1398 KiB | 15 Q