3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'Äßmeier_von_Ümlauts_aÌ.jpg'; function replaceUmlauts(string $string): string { $umlauts = [ 'Ä' => 'Ae', 'ä' => 'ae', 'Ö' => 'Oe', 'ö' => 'oe', 'Ü' => 'Ue', 'ü' => 'ue', 'ß' => 'ss', ]; foreach ($umlauts as $umlaut => $replacement) { $string = str_replace($umlaut, $replacement, $string); } return $string; } $normalized = Normalizer::normalize($string, Normalizer::FORM_KD); var_dump($normalized); var_dump(Normalizer::isNormalized($normalized, Normalizer::FORM_KD)); $normalized2 = Normalizer::getRawDecomposition($normalized); var_dump($normalized2); var_dump(iconv("UTF-8", "ASCII//TRANSLIT", $normalized));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/guDAn
function name:  (null)
number of ops:  34
compiled vars:  !0 = $string, !1 = $normalized, !2 = $normalized2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%C3%84%C3%9Fmeier_von_%C3%9Cmlauts_a%C3%8C.jpg'
   22     1        INIT_STATIC_METHOD_CALL                                  'Normalizer', 'normalize'
          2        SEND_VAR_EX                                              !0
          3        FETCH_CLASS_CONSTANT                             ~4      'Normalizer', 'FORM_KD'
          4        SEND_VAL_EX                                              ~4
          5        DO_FCALL                                      0  $5      
          6        ASSIGN                                                   !1, $5
   23     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
   24    10        INIT_FCALL                                               'var_dump'
         11        INIT_STATIC_METHOD_CALL                                  'Normalizer', 'isNormalized'
         12        SEND_VAR_EX                                              !1
         13        FETCH_CLASS_CONSTANT                             ~8      'Normalizer', 'FORM_KD'
         14        SEND_VAL_EX                                              ~8
         15        DO_FCALL                                      0  $9      
         16        SEND_VAR                                                 $9
         17        DO_ICALL                                                 
   25    18        INIT_STATIC_METHOD_CALL                                  'Normalizer', 'getRawDecomposition'
         19        SEND_VAR_EX                                              !1
         20        DO_FCALL                                      0  $11     
         21        ASSIGN                                                   !2, $11
   26    22        INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                                 
   27    25        INIT_FCALL                                               'var_dump'
         26        INIT_FCALL_BY_NAME                                       'iconv'
         27        SEND_VAL_EX                                              'UTF-8'
         28        SEND_VAL_EX                                              'ASCII%2F%2FTRANSLIT'
         29        SEND_VAR_EX                                              !1
         30        DO_FCALL                                      0  $14     
         31        SEND_VAR                                                 $14
         32        DO_ICALL                                                 
         33      > RETURN                                                   1

Function replaceumlauts:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 12
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/guDAn
function name:  replaceUmlauts
number of ops:  17
compiled vars:  !0 = $string, !1 = $umlauts, !2 = $replacement, !3 = $umlaut
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        ASSIGN                                                   !1, <array>
   16     2      > FE_RESET_R                                       $5      !1, ->12
          3    > > FE_FETCH_R                                       ~6      $5, !2, ->12
          4    >   ASSIGN                                                   !3, ~6
   17     5        INIT_FCALL                                               'str_replace'
          6        SEND_VAR                                                 !3
          7        SEND_VAR                                                 !2
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $8      
         10        ASSIGN                                                   !0, $8
   16    11      > JMP                                                      ->3
         12    >   FE_FREE                                                  $5
   19    13        VERIFY_RETURN_TYPE                                       !0
         14      > RETURN                                                   !0
   20    15*       VERIFY_RETURN_TYPE                                       
         16*     > RETURN                                                   null

End of function replaceumlauts

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.2 ms | 1400 KiB | 17 Q