3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "Фадэь ёэ хфигцаёачр гэытиочр!"; die(Var_dump(chr(208))); die(var_dump(ord($string[0]))); function rotn($string, $n) { $alphabet = array( 1 => "а", 2 => "б", 3 => "в", 4 => "г", 5 => "д", 6 => "е", 7 => "ё", 8 => "ж", 9 => "з", 10 => "и", 11 => "й", 12 => "к", 13 => "л", 14 => "м", 15 => "н", 16 => "о", 17 => "п", 18 => "р", 19 => "с", 20 => "т", 21 => "у", 22 => "ф", 23 => "х", 24 => "ц", 25 => "ч", 26 => "ш", 27 => "щ", 28 => "ъ", 29 => "ы", 30 => "ь", 31 => "э", 32 => "ю", 33 => "я" ); $alphabet_r = array_flip($alphabet); $string = strtolower($string); foreach (str_split(strtolower($string), 1) as $character) { die(var_dump($character, $alphabet_r[$character])); //echo $character; echo $alphabet[$alphabet_r[$character] + $n]; } } rotn($string, 1);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/0F2SH
function name:  (null)
number of ops:  18
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%D0%A4%D0%B0%D0%B4%D1%8D%D1%8C+%D1%91%D1%8D+%D1%85%D1%84%D0%B8%D0%B3%D1%86%D0%B0%D1%91%D0%B0%D1%87%D1%80+%D0%B3%D1%8D%D1%8B%D1%82%D0%B8%D0%BE%D1%87%D1%80%21'
    5     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAL                                                 '%D0'
          3        DO_ICALL                                         $2      
          4      > EXIT                                                     $2
    6     5*       INIT_FCALL                                               'var_dump'
          6*       INIT_FCALL                                               'ord'
          7*       FETCH_DIM_R                                      ~3      !0, 0
          8*       SEND_VAL                                                 ~3
          9*       DO_ICALL                                         $4      
         10*       SEND_VAR                                                 $4
         11*       DO_ICALL                                         $5      
         12*       EXIT                                                     $5
   29    13*       INIT_FCALL                                               'rotn'
         14*       SEND_VAR                                                 !0
         15*       SEND_VAL                                                 1
         16*       DO_FCALL                                      0          
         17*     > RETURN                                                   1

Function rotn:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 31
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 31
Branch analysis from position: 20
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
filename:       /in/0F2SH
function name:  rotn
number of ops:  33
compiled vars:  !0 = $string, !1 = $n, !2 = $alphabet, !3 = $alphabet_r, !4 = $character
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    9     2        ASSIGN                                                   !2, <array>
   20     3        INIT_FCALL                                               'array_flip'
          4        SEND_VAR                                                 !2
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !3, $6
   21     7        INIT_FCALL                                               'strtolower'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $8      
         10        ASSIGN                                                   !0, $8
   22    11        INIT_FCALL                                               'str_split'
         12        INIT_FCALL                                               'strtolower'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $10     
         15        SEND_VAR                                                 $10
         16        SEND_VAL                                                 1
         17        DO_ICALL                                         $11     
         18      > FE_RESET_R                                       $12     $11, ->31
         19    > > FE_FETCH_R                                               $12, !4, ->31
   23    20    >   INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !4
         22        FETCH_DIM_R                                      ~13     !3, !4
         23        SEND_VAL                                                 ~13
         24        DO_ICALL                                         $14     
         25      > EXIT                                                     $14
   25    26*       FETCH_DIM_R                                      ~15     !3, !4
         27*       ADD                                              ~16     ~15, !1
         28*       FETCH_DIM_R                                      ~17     !2, ~16
         29*       ECHO                                                     ~17
   22    30*       JMP                                                      ->19
         31    >   FE_FREE                                                  $12
   27    32      > RETURN                                                   null

End of function rotn

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.97 ms | 1402 KiB | 24 Q