3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'Test emoji \U0001F607 \U0001F63C'; echo preg_replace_callback( '/\\\U([A-F0-9]+)/', function ($matches) { return mb_convert_encoding(hex2bin($matches[1]), 'UTF-8', 'UTF-32'); }, $str );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/63dUR
function name:  (null)
number of ops:  9
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Test+emoji+%5CU0001F607+%5CU0001F63C'
    5     1        INIT_FCALL                                               'preg_replace_callback'
    6     2        SEND_VAL                                                 '%2F%5C%5CU%28%5BA-F0-9%5D%2B%29%2F'
    7     3        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
    9     4        SEND_VAL                                                 ~2
   10     5        SEND_VAR                                                 !0
    5     6        DO_ICALL                                         $3      
   10     7        ECHO                                                     $3
   11     8      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/63dUR
function name:  {closure}
number of ops:  12
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        INIT_FCALL                                               'mb_convert_encoding'
          2        INIT_FCALL                                               'hex2bin'
          3        FETCH_DIM_R                                      ~1      !0, 1
          4        SEND_VAL                                                 ~1
          5        DO_ICALL                                         $2      
          6        SEND_VAR                                                 $2
          7        SEND_VAL                                                 'UTF-8'
          8        SEND_VAL                                                 'UTF-32'
          9        DO_ICALL                                         $3      
         10      > RETURN                                                   $3
    9    11*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.18 ms | 1004 KiB | 16 Q