3v4l.org

run code in 300+ PHP versions simultaneously
<?php //Source: https://bugs.php.net/bug.php?id=63898 $key = "Foo " . chr(163); $array = array($key => ""); print_r($array); $json = json_encode($array); echo "JSON: ".$json."\n"; $json = '{"FOO' . chr(163) . '": ""}'; echo "JSON: ".$json."\n"; var_dump(json_decode($json));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WDdgt
function name:  (null)
number of ops:  24
compiled vars:  !0 = $key, !1 = $array, !2 = $json
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'Foo+%A3'
    5     1        INIT_ARRAY                                       ~4      '', !0
          2        ASSIGN                                                   !1, ~4
    7     3        INIT_FCALL                                               'print_r'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                                 
    9     6        INIT_FCALL                                               'json_encode'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $7      
          9        ASSIGN                                                   !2, $7
   10    10        CONCAT                                           ~9      'JSON%3A+', !2
         11        CONCAT                                           ~10     ~9, '%0A'
         12        ECHO                                                     ~10
   12    13        ASSIGN                                                   !2, '%7B%22FOO%A3%22%3A+%22%22%7D'
   13    14        CONCAT                                           ~12     'JSON%3A+', !2
         15        CONCAT                                           ~13     ~12, '%0A'
         16        ECHO                                                     ~13
   15    17        INIT_FCALL                                               'var_dump'
         18        INIT_FCALL                                               'json_decode'
         19        SEND_VAR                                                 !2
         20        DO_ICALL                                         $14     
         21        SEND_VAR                                                 $14
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.06 ms | 1395 KiB | 21 Q