3v4l.org

run code in 300+ PHP versions simultaneously
<?php function decode(string $phrase): string { $dictionary = [ 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 => 'ъ', ]; $words = explode(' ', $phrase); $result = ''; foreach ($words as $word) { $letters = explode('.', $word); $result .= ' ' . implode('', array_map(function ($value) use ($dictionary) { $index = (int) $value; if ($index < 1 || $index > 33) { return $value; } return $dictionary[(int)$value]; }, $letters)); } return $result; } echo decode('12.6.24 21.6.28.2.19.7 19.20.2 17.728.29.2 11.32.24.31 6.12.20.6.19.76.19.4 6.23.7.15.14.1.9.24 19.2.20.10 21.22.2.15.12.3 , 28.2.19 7.16.20.1.9.24.');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k0aut
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   62     0  E >   INIT_FCALL                                               'decode'
          1        SEND_VAL                                                 '12.6.24+21.6.28.2.19.7+19.20.2+17.728.29.2+11.32.24.31+6.12.20.6.19.76.19.4+6.23.7.15.14.1.9.24+19.2.20.10+21.22.2.15.12.3+%2C+28.2.19+7.16.20.1.9.24.'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function decode:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 28
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 28
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/k0aut
function name:  decode
number of ops:  33
compiled vars:  !0 = $phrase, !1 = $dictionary, !2 = $words, !3 = $result, !4 = $word, !5 = $letters
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !1, <array>
   41     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '+'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $7      
          6        ASSIGN                                                   !2, $7
   43     7        ASSIGN                                                   !3, ''
   45     8      > FE_RESET_R                                       $10     !2, ->28
          9    > > FE_FETCH_R                                               $10, !4, ->28
   46    10    >   INIT_FCALL                                               'explode'
         11        SEND_VAL                                                 '.'
         12        SEND_VAR                                                 !4
         13        DO_ICALL                                         $11     
         14        ASSIGN                                                   !5, $11
   48    15        INIT_FCALL                                               'implode'
         16        SEND_VAL                                                 ''
         17        INIT_FCALL                                               'array_map'
         18        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fk0aut%3A48%240'
         19        BIND_LEXICAL                                             ~13, !1
   56    20        SEND_VAL                                                 ~13
         21        SEND_VAR                                                 !5
         22        DO_ICALL                                         $14     
         23        SEND_VAR                                                 $14
         24        DO_ICALL                                         $15     
         25        CONCAT                                           ~16     '+', $15
         26        ASSIGN_OP                                     8          !3, ~16
   45    27      > JMP                                                      ->9
         28    >   FE_FREE                                                  $10
   59    29        VERIFY_RETURN_TYPE                                       !3
         30      > RETURN                                                   !3
   60    31*       VERIFY_RETURN_TYPE                                       
         32*     > RETURN                                                   null

End of function decode

Function %00%7Bclosure%7D%2Fin%2Fk0aut%3A48%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/k0aut
function name:  {closure}
number of ops:  14
compiled vars:  !0 = $value, !1 = $dictionary, !2 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   48     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   49     2        CAST                                          4  ~3      !0
          3        ASSIGN                                                   !2, ~3
   51     4        IS_SMALLER                                       ~5      !2, 1
          5      > JMPNZ_EX                                         ~5      ~5, ->8
          6    >   IS_SMALLER                                       ~6      33, !2
          7        BOOL                                             ~5      ~6
          8    > > JMPZ                                                     ~5, ->10
   52     9    > > RETURN                                                   !0
   55    10    >   CAST                                          4  ~7      !0
         11        FETCH_DIM_R                                      ~8      !1, ~7
         12      > RETURN                                                   ~8
   56    13*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fk0aut%3A48%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.53 ms | 1402 KiB | 20 Q