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 = '{ "baz": "bar" }'; echo "GOOD" . json_decode($good_json);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4al55
function name:  (null)
number of ops:  13
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        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $3      
          4        CONCAT                                           ~4      'BAD%3A', $3
          5        ECHO                                                     ~4
    8     6        ASSIGN                                                   !1, '%7B+%22baz%22%3A+%22bar%22+%7D'
    9     7        INIT_FCALL                                               'json_decode'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $6      
         10        CONCAT                                           ~7      'GOOD', $6
         11        ECHO                                                     ~7
         12      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.81 ms | 1394 KiB | 15 Q