3v4l.org

run code in 300+ PHP versions simultaneously
<? error_reporting(E_ALL); ini_set("display_errors", 1); function unicode_decode($str){ return preg_replace("/\\\u([0-9A-F]{4})/ie", "iconv('utf-16', 'utf-8', hex2str(\"$1\"))", $str); } function hex2str($hex) { $r = ''; for ($i = 0; $i < strlen($hex) - 1; $i += 2) $r .= chr(hexdec($hex[$i] . $hex[$i + 1])); return $r; } function json_utfencode($string) { return unicode_decode(json_encode($string, JSON_UNESCAPED_UNICODE)); } $arr[0]['ip'] = "İyi Yazar İçin Şunlara"; $arr[0]['time'] = time(); echo json_utfencode(array_values($arr)); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GILKs
function name:  (null)
number of ops:  23
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 32767
          2        DO_ICALL                                                 
    3     3        INIT_FCALL                                               'ini_set'
          4        SEND_VAL                                                 'display_errors'
          5        SEND_VAL                                                 1
          6        DO_ICALL                                                 
   21     7        FETCH_DIM_W                                      $3      !0, 0
          8        ASSIGN_DIM                                               $3, 'ip'
          9        OP_DATA                                                  '%C4%B0yi+Yazar+%C4%B0%C3%A7in+%C5%9Eunlara'
   22    10        INIT_FCALL                                               'time'
         11        DO_ICALL                                         $7      
         12        FETCH_DIM_W                                      $5      !0, 0
         13        ASSIGN_DIM                                               $5, 'time'
         14        OP_DATA                                                  $7
   24    15        INIT_FCALL                                               'json_utfencode'
         16        INIT_FCALL                                               'array_values'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $8      
         19        SEND_VAR                                                 $8
         20        DO_FCALL                                      0  $9      
         21        ECHO                                                     $9
   25    22      > RETURN                                                   1

Function unicode_decode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GILKs
function name:  unicode_decode
number of ops:  8
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%5C%5Cu%28%5B0-9A-F%5D%7B4%7D%29%2Fie'
          3        SEND_VAL                                                 'iconv%28%27utf-16%27%2C+%27utf-8%27%2C+hex2str%28%22%241%22%29%29'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $1      
          6      > RETURN                                                   $1
    7     7*     > RETURN                                                   null

End of function unicode_decode

Function hex2str:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 4
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 4
Branch analysis from position: 20
Branch analysis from position: 4
filename:       /in/GILKs
function name:  hex2str
number of ops:  22
compiled vars:  !0 = $hex, !1 = $r, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        ASSIGN                                                   !1, ''
   10     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->16
   11     4    >   INIT_FCALL                                               'chr'
          5        INIT_FCALL                                               'hexdec'
          6        FETCH_DIM_R                                      ~5      !0, !2
          7        ADD                                              ~6      !2, 1
          8        FETCH_DIM_R                                      ~7      !0, ~6
          9        CONCAT                                           ~8      ~5, ~7
         10        SEND_VAL                                                 ~8
         11        DO_ICALL                                         $9      
         12        SEND_VAR                                                 $9
         13        DO_ICALL                                         $10     
         14        ASSIGN_OP                                     8          !1, $10
   10    15        ASSIGN_OP                                     1          !2, 2
         16    >   STRLEN                                           ~13     !0
         17        SUB                                              ~14     ~13, 1
         18        IS_SMALLER                                               !2, ~14
         19      > JMPNZ                                                    ~15, ->4
   12    20    > > RETURN                                                   !1
   13    21*     > RETURN                                                   null

End of function hex2str

Function json_utfencode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GILKs
function name:  json_utfencode
number of ops:  10
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   17     1        INIT_FCALL                                               'unicode_decode'
          2        INIT_FCALL                                               'json_encode'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 256
          5        DO_ICALL                                         $1      
          6        SEND_VAR                                                 $1
          7        DO_FCALL                                      0  $2      
          8      > RETURN                                                   $2
   19     9*     > RETURN                                                   null

End of function json_utfencode

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.62 ms | 1403 KiB | 31 Q