3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * @helghanman decryption algorithm * DECLASSIFIED///VSA///SIGINT///DECRYPT */ # Encoded message $message ='077175091 084063 056035 168021105056175084'; # do not edit below this line!! /******************************************************************/ # Cipher substitution $substitutionArray = array( 'q' => 1, 'w' => 2, 'e' => 3, 'r' => 4, 't' => 5, 'y' => 6, 'u' => 7, 'i' => 8, 'o' => 9, 'p' => 10, 'a' => 11, 's' => 12, 'd' => 13, 'f' => 14, 'g' => 15, 'h' => 16, 'j' => 17, 'k' => 18, 'l' => 19, 'z' => 20, 'x' => 21, 'c' => 22, 'v' => 23, 'b' => 24, 'n' => 25, 'm' => 26, ',' => 27, '.' => 28, '1' => 29, '2' => 30, '3' => 31, '4' => 32, '5' => 33, '6' => 34, '7' => 35, '8' => 36, '9' => 37, '#' => 38, ); # Rotation7 $r = 7; # Decoding algorithm function decode($string, $substitutionArray, $r = 1) { $result = ''; $stringArray = explode(" ", $string); $substitutionArray = array_flip($substitutionArray); foreach ($stringArray as $word) { for ($i = 0; $i <= strlen($word)-3; ) { $cipher = intval(substr($word, $i, 3))/$r; $result .= $substitutionArray[$cipher]; $i = $i+3; } $result .= ' '; } return $result; } # Print decoded message print decode($message, $substitutionArray, $r); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ne68Q
function name:  (null)
number of ops:  10
compiled vars:  !0 = $message, !1 = $substitutionArray, !2 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, '077175091+084063+056035+168021105056175084'
   14     1        ASSIGN                                                   !1, <array>
   56     2        ASSIGN                                                   !2, 7
   75     3        INIT_FCALL                                               'decode'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        SEND_VAR                                                 !2
          7        DO_FCALL                                      0  $6      
          8        ECHO                                                     $6
   76     9      > RETURN                                                   1

Function decode:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 35
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 35
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 17
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 17
Branch analysis from position: 33
Branch analysis from position: 17
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
filename:       /in/Ne68Q
function name:  decode
number of ops:  38
compiled vars:  !0 = $string, !1 = $substitutionArray, !2 = $r, !3 = $result, !4 = $stringArray, !5 = $word, !6 = $i, !7 = $cipher
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   59     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      1
   60     3        ASSIGN                                                   !3, ''
   61     4        INIT_FCALL                                               'explode'
          5        SEND_VAL                                                 '+'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $9      
          8        ASSIGN                                                   !4, $9
   62     9        INIT_FCALL                                               'array_flip'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $11     
         12        ASSIGN                                                   !1, $11
   63    13      > FE_RESET_R                                       $13     !4, ->35
         14    > > FE_FETCH_R                                               $13, !5, ->35
   64    15    >   ASSIGN                                                   !6, 0
         16      > JMP                                                      ->29
   65    17    >   INIT_FCALL                                               'substr'
         18        SEND_VAR                                                 !5
         19        SEND_VAR                                                 !6
         20        SEND_VAL                                                 3
         21        DO_ICALL                                         $15     
         22        CAST                                          4  ~16     $15
         23        DIV                                              ~17     ~16, !2
         24        ASSIGN                                                   !7, ~17
   66    25        FETCH_DIM_R                                      ~19     !1, !7
         26        ASSIGN_OP                                     8          !3, ~19
   67    27        ADD                                              ~21     !6, 3
         28        ASSIGN                                                   !6, ~21
   64    29    >   STRLEN                                           ~23     !5
         30        SUB                                              ~24     ~23, 3
         31        IS_SMALLER_OR_EQUAL                                      !6, ~24
         32      > JMPNZ                                                    ~25, ->17
   69    33    >   ASSIGN_OP                                     8          !3, '+'
   63    34      > JMP                                                      ->14
         35    >   FE_FREE                                                  $13
   71    36      > RETURN                                                   !3
   72    37*     > RETURN                                                   null

End of function decode

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.4 ms | 1403 KiB | 20 Q