3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo bin2hex("my utf8 string áéíóú"), "\n", bin2hex(iconv("UTF-8", "Windows-1252", "my utf8 string áéíóú")); $string = ''; foreach(str_split(iconv("UTF-8", "Windows-1252", "my utf8 string áéíóú")) as $n => $c) { if (ord($c) > 127) { $c = '%'.bin2hex($c); } $string .= $c; } var_dump($string);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 24, Position 2 = 38
Branch analysis from position: 24
2 jumps found. (Code = 78) Position 1 = 25, Position 2 = 38
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 36
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 36
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
filename:       /in/PLqKJ
function name:  (null)
number of ops:  43
compiled vars:  !0 = $string, !1 = $c, !2 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'bin2hex'
          1        SEND_VAL                                                 'my+utf8+string+%C3%A1%C3%A9%C3%AD%C3%B3%C3%BA'
          2        DO_ICALL                                         $3      
          3        ECHO                                                     $3
          4        ECHO                                                     '%0A'
          5        INIT_FCALL                                               'bin2hex'
          6        INIT_FCALL_BY_NAME                                       'iconv'
          7        SEND_VAL_EX                                              'UTF-8'
          8        SEND_VAL_EX                                              'Windows-1252'
          9        SEND_VAL_EX                                              'my+utf8+string+%C3%A1%C3%A9%C3%AD%C3%B3%C3%BA'
         10        DO_FCALL                                      0  $4      
         11        SEND_VAR                                                 $4
         12        DO_ICALL                                         $5      
         13        ECHO                                                     $5
    5    14        ASSIGN                                                   !0, ''
    6    15        INIT_FCALL                                               'str_split'
         16        INIT_FCALL_BY_NAME                                       'iconv'
         17        SEND_VAL_EX                                              'UTF-8'
         18        SEND_VAL_EX                                              'Windows-1252'
         19        SEND_VAL_EX                                              'my+utf8+string+%C3%A1%C3%A9%C3%AD%C3%B3%C3%BA'
         20        DO_FCALL                                      0  $7      
         21        SEND_VAR                                                 $7
         22        DO_ICALL                                         $8      
         23      > FE_RESET_R                                       $9      $8, ->38
         24    > > FE_FETCH_R                                       ~10     $9, !1, ->38
         25    >   ASSIGN                                                   !2, ~10
    7    26        INIT_FCALL                                               'ord'
         27        SEND_VAR                                                 !1
         28        DO_ICALL                                         $12     
         29        IS_SMALLER                                               127, $12
         30      > JMPZ                                                     ~13, ->36
    8    31    >   INIT_FCALL                                               'bin2hex'
         32        SEND_VAR                                                 !1
         33        DO_ICALL                                         $14     
         34        CONCAT                                           ~15     '%25', $14
         35        ASSIGN                                                   !1, ~15
   10    36    >   ASSIGN_OP                                     8          !0, !1
    6    37      > JMP                                                      ->24
         38    >   FE_FREE                                                  $9
   13    39        INIT_FCALL                                               'var_dump'
         40        SEND_VAR                                                 !0
         41        DO_ICALL                                                 
         42      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.38 ms | 1400 KiB | 21 Q