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."\n"; var_dump(json_decode($json), json_last_error(), json_last_error_msg());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gMA2I
function name:  (null)
number of ops:  25
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      !2, '%0A'
         11        ECHO                                                     ~9
   12    12        INIT_FCALL                                               'var_dump'
         13        INIT_FCALL                                               'json_decode'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                         $10     
         16        SEND_VAR                                                 $10
         17        INIT_FCALL                                               'json_last_error'
         18        DO_ICALL                                         $11     
         19        SEND_VAR                                                 $11
         20        INIT_FCALL                                               'json_last_error_msg'
         21        DO_ICALL                                         $12     
         22        SEND_VAR                                                 $12
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.26 ms | 1395 KiB | 25 Q