3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "{'name': 'Vanliga fr\u00e5gor'}"; function replace_unicode_escape_sequence($match) { return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE'); } $str = json_decode($str); print $str;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LvGGQ
function name:  (null)
number of ops:  7
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7B%27name%27%3A+%27Vanliga+fr%5Cu00e5gor%27%7D'
    7     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $2      
          4        ASSIGN                                                   !0, $2
    8     5        ECHO                                                     !0
          6      > RETURN                                                   1

Function replace_unicode_escape_sequence:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LvGGQ
function name:  replace_unicode_escape_sequence
number of ops:  13
compiled vars:  !0 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'mb_convert_encoding'
          2        INIT_FCALL                                               'pack'
          3        SEND_VAL                                                 'H%2A'
          4        FETCH_DIM_R                                      ~1      !0, 1
          5        SEND_VAL                                                 ~1
          6        DO_ICALL                                         $2      
          7        SEND_VAR                                                 $2
          8        SEND_VAL                                                 'UTF-8'
          9        SEND_VAL                                                 'UCS-2BE'
         10        DO_ICALL                                         $3      
         11      > RETURN                                                   $3
    6    12*     > RETURN                                                   null

End of function replace_unicode_escape_sequence

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.58 ms | 1395 KiB | 19 Q