3v4l.org

run code in 300+ PHP versions simultaneously
<?php // the following strings are valid JavaScript but not valid JSON // the name and value must be enclosed in double quotes // single quotes are not valid $bad_json = "{ 'bar': 'baz' }"; json_decode($bad_json); // null // the name must be enclosed in double quotes $bad_json = '{ bar: "baz" }'; json_decode($bad_json); // null // trailing commas are not allowed $bad_json = '{ bar: "baz", }'; json_decode($bad_json); // null ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YkXUN
function name:  (null)
number of ops:  13
compiled vars:  !0 = $bad_json
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, '%7B+%27bar%27%3A+%27baz%27+%7D'
    8     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   11     4        ASSIGN                                                   !0, '%7B+bar%3A+%22baz%22+%7D'
   12     5        INIT_FCALL                                               'json_decode'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
   15     8        ASSIGN                                                   !0, '%7B+bar%3A+%22baz%22%2C+%7D'
   16     9        INIT_FCALL                                               'json_decode'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                                 
   18    12      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.03 ms | 1398 KiB | 15 Q