3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** by www.phpddt.com */ $arr = array("a"=>"PHP","b"=>"中国"); echo json_encode($arr); //中文乱码:["PHP","\u4e2d\u56fd"] //json_encode前对变量urlencode即可 foreach ($arr as $k => $v){ $arr[$k] = urlencode($v); } echo urldecode(json_encode($arr)); //{"a":"PHP","b":"中国"}
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 14
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 14
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/Frbj6
function name:  (null)
number of ops:  23
compiled vars:  !0 = $arr, !1 = $v, !2 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'json_encode'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $4      
          4        ECHO                                                     $4
    6     5      > FE_RESET_R                                       $5      !0, ->14
          6    > > FE_FETCH_R                                       ~6      $5, !1, ->14
          7    >   ASSIGN                                                   !2, ~6
    7     8        INIT_FCALL                                               'urlencode'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $9      
         11        ASSIGN_DIM                                               !0, !2
         12        OP_DATA                                                  $9
    6    13      > JMP                                                      ->6
         14    >   FE_FREE                                                  $5
    9    15        INIT_FCALL                                               'urldecode'
         16        INIT_FCALL                                               'json_encode'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $10     
         19        SEND_VAR                                                 $10
         20        DO_ICALL                                         $11     
         21        ECHO                                                     $11
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.99 ms | 1395 KiB | 19 Q