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:"; print_r(json_decode($bad_json)); // null $good_json = '{"foo-bar": 12345}'; echo "\nGOOD:"; print_r(json_decode($good_json));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6I4t7
function name:  (null)
number of ops:  17
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                                               'print_r'
          3        INIT_FCALL                                               'json_decode'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        SEND_VAR                                                 $3
          7        DO_ICALL                                                 
    9     8        ASSIGN                                                   !1, '%7B%22foo-bar%22%3A+12345%7D'
   10     9        ECHO                                                     '%0AGOOD%3A'
   11    10        INIT_FCALL                                               'print_r'
         11        INIT_FCALL                                               'json_decode'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $6      
         14        SEND_VAR                                                 $6
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.46 ms | 1394 KiB | 17 Q