3v4l.org

run code in 300+ PHP versions simultaneously
<?php function replaceUmlaut($s) { $r = ''; $s1 = iconv('UTF-8', 'ASCII//TRANSLIT', $s); for ($i = 0; $i < strlen($s1); $i++) { $ch1 = $s1[$i]; $ch2 = mb_substr($s, $i, 1); $r .= $ch1=='?'?$ch2:$ch1; } $r = preg_replace("=\W=is", "", $r); return $r; } printf("Sévèrîn Tést = %s", replaceUmlaut("Sévèrîn Tést"));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/N6dHm
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                               'printf'
          1        SEND_VAL                                                 'S%C3%A9v%C3%A8r%C3%AEn+T%C3%A9st+%3D+%25s'
          2        INIT_FCALL                                               'replaceumlaut'
          3        SEND_VAL                                                 'S%C3%A9v%C3%A8r%C3%AEn+T%C3%A9st'
          4        DO_FCALL                                      0  $0      
          5        SEND_VAR                                                 $0
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function replaceumlaut:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 10
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 22
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 10
Branch analysis from position: 28
Branch analysis from position: 10
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 10
Branch analysis from position: 28
Branch analysis from position: 10
filename:       /in/N6dHm
function name:  replaceUmlaut
number of ops:  36
compiled vars:  !0 = $s, !1 = $r, !2 = $s1, !3 = $i, !4 = $ch1, !5 = $ch2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, ''
    5     2        INIT_FCALL_BY_NAME                                       'iconv'
          3        SEND_VAL_EX                                              'UTF-8'
          4        SEND_VAL_EX                                              'ASCII%2F%2FTRANSLIT'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0  $7      
          7        ASSIGN                                                   !2, $7
    7     8        ASSIGN                                                   !3, 0
          9      > JMP                                                      ->25
    9    10    >   FETCH_DIM_R                                      ~10     !2, !3
         11        ASSIGN                                                   !4, ~10
   10    12        INIT_FCALL                                               'mb_substr'
         13        SEND_VAR                                                 !0
         14        SEND_VAR                                                 !3
         15        SEND_VAL                                                 1
         16        DO_ICALL                                         $12     
         17        ASSIGN                                                   !5, $12
   12    18        IS_EQUAL                                                 !4, '%3F'
         19      > JMPZ                                                     ~14, ->22
         20    >   QM_ASSIGN                                        ~15     !5
         21      > JMP                                                      ->23
         22    >   QM_ASSIGN                                        ~15     !4
         23    >   ASSIGN_OP                                     8          !1, ~15
    7    24        PRE_INC                                                  !3
         25    >   STRLEN                                           ~18     !2
         26        IS_SMALLER                                               !3, ~18
         27      > JMPNZ                                                    ~19, ->10
   15    28    >   INIT_FCALL                                               'preg_replace'
         29        SEND_VAL                                                 '%3D%5CW%3Dis'
         30        SEND_VAL                                                 ''
         31        SEND_VAR                                                 !1
         32        DO_ICALL                                         $20     
         33        ASSIGN                                                   !1, $20
   17    34      > RETURN                                                   !1
   18    35*     > RETURN                                                   null

End of function replaceumlaut

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.07 ms | 1402 KiB | 23 Q