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_KC); var_dump($normalized); var_dump(Normalizer::isNormalized($normalized, Normalizer::FORM_KC)); 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/QIRvZ
function name:  (null)
number of ops:  27
compiled vars:  !0 = $string, !1 = $normalized
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                             ~3      'Normalizer', 'FORM_KC'
          4        SEND_VAL_EX                                              ~3
          5        DO_FCALL                                      0  $4      
          6        ASSIGN                                                   !1, $4
   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                             ~7      'Normalizer', 'FORM_KC'
         14        SEND_VAL_EX                                              ~7
         15        DO_FCALL                                      0  $8      
         16        SEND_VAR                                                 $8
         17        DO_ICALL                                                 
   25    18        INIT_FCALL                                               'var_dump'
         19        INIT_FCALL_BY_NAME                                       'iconv'
         20        SEND_VAL_EX                                              'UTF-8'
         21        SEND_VAL_EX                                              'ASCII%2F%2FTRANSLIT'
         22        SEND_VAR_EX                                              !1
         23        DO_FCALL                                      0  $10     
         24        SEND_VAR                                                 $10
         25        DO_ICALL                                                 
         26      > 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/QIRvZ
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:
146.99 ms | 1400 KiB | 20 Q