3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "\ud83d\ude01"; $str = json_decode('"' . $str . '"'); $bytes = str_split($str); for ($i = 0; $i < count($bytes); $i++) { $bytes[$i] = "\x" . dechex(ord($bytes[$i])); } $str = implode('',$bytes); echo $str;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 13
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 13
Branch analysis from position: 27
Branch analysis from position: 13
filename:       /in/A1PEn
function name:  (null)
number of ops:  34
compiled vars:  !0 = $str, !1 = $bytes, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%5Cud83d%5Cude01'
    3     1        INIT_FCALL                                               'json_decode'
          2        CONCAT                                           ~4      '%22', !0
          3        CONCAT                                           ~5      ~4, '%22'
          4        SEND_VAL                                                 ~5
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !0, $6
    4     7        INIT_FCALL                                               'str_split'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $8      
         10        ASSIGN                                                   !1, $8
    5    11        ASSIGN                                                   !2, 0
         12      > JMP                                                      ->24
    6    13    >   INIT_FCALL                                               'dechex'
         14        INIT_FCALL                                               'ord'
         15        FETCH_DIM_R                                      ~12     !1, !2
         16        SEND_VAL                                                 ~12
         17        DO_ICALL                                         $13     
         18        SEND_VAR                                                 $13
         19        DO_ICALL                                         $14     
         20        CONCAT                                           ~15     '%5Cx', $14
         21        ASSIGN_DIM                                               !1, !2
         22        OP_DATA                                                  ~15
    5    23        PRE_INC                                                  !2
         24    >   COUNT                                            ~17     !1
         25        IS_SMALLER                                               !2, ~17
         26      > JMPNZ                                                    ~18, ->13
    8    27    >   INIT_FCALL                                               'implode'
         28        SEND_VAL                                                 ''
         29        SEND_VAR                                                 !1
         30        DO_ICALL                                         $19     
         31        ASSIGN                                                   !0, $19
   10    32        ECHO                                                     !0
   11    33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.44 ms | 1016 KiB | 18 Q