3v4l.org

run code in 300+ PHP versions simultaneously
<?php function unicode2utf8_2($str){ //关于unicode编码转化的第二个函数,用于显示emoji表情 $str = '{"result_str":"'.$str.'"}'; //组合成json格式 $strarray = json_decode($str,true); //json转换为数组,利用 JSON 对 \uXXXX 的支持来把转义符恢复为 Unicode 字符(by 梁海) return $strarray['result_str']; } echo unicode2utf8_2("\ue159")."【公交/地铁】";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bubW6
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'unicode2utf8_2'
          1        SEND_VAL                                                 '%5Cue159'
          2        DO_FCALL                                      0  $0      
          3        CONCAT                                           ~1      $0, '%E3%80%90%E5%85%AC%E4%BA%A4%2F%E5%9C%B0%E9%93%81%E3%80%91'
          4        ECHO                                                     ~1
          5      > RETURN                                                   1

Function unicode2utf8_2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bubW6
function name:  unicode2utf8_2
number of ops:  12
compiled vars:  !0 = $str, !1 = $strarray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        CONCAT                                           ~2      '%7B%22result_str%22%3A%22', !0
          2        CONCAT                                           ~3      ~2, '%22%7D'
          3        ASSIGN                                                   !0, ~3
    4     4        INIT_FCALL                                               'json_decode'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 <true>
          7        DO_ICALL                                         $5      
          8        ASSIGN                                                   !1, $5
    5     9        FETCH_DIM_R                                      ~7      !1, 'result_str'
         10      > RETURN                                                   ~7
    6    11*     > RETURN                                                   null

End of function unicode2utf8_2

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.15 ms | 1397 KiB | 16 Q