3v4l.org

run code in 300+ PHP versions simultaneously
<?php function diacriticsToNumbers($str) { $replace = [ '+' => 1, 'ě' => 2, 'š' => 3, 'č' => 4, 'ř' => 5, 'ž' => 6, 'ý' => 7, 'á' => 8, 'í' => 9, 'é' => 0, 'Ě' => 2, 'Š' => 3, 'Č' => 4, 'Ř' => 5, 'Ž' => 6, 'Ý' => 7, 'Á' => 8, 'Í' => 9, 'É' => 0, ]; return strtr($str, $replace); } echo diacriticsToNumbers('áéé ššé éýž');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CD6PM
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   INIT_FCALL                                               'diacriticstonumbers'
          1        SEND_VAL                                                 '%C3%A1%C3%A9%C3%A9+%C5%A1%C5%A1%C3%A9+%C3%A9%C3%BD%C5%BE'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function diacriticstonumbers:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CD6PM
function name:  diacriticsToNumbers
number of ops:  8
compiled vars:  !0 = $str, !1 = $replace
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, <array>
   25     2        INIT_FCALL                                               'strtr'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $3      
          6      > RETURN                                                   $3
   26     7*     > RETURN                                                   null

End of function diacriticstonumbers

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.53 ms | 1396 KiB | 16 Q