3v4l.org

run code in 300+ PHP versions simultaneously
<?php $cryptArray = array( "a"=>"xyz","b"=>"256"); $string = "aab"; function cryptit($string,$cryptArray){ $temp = ""; $length = strlen($string); for($i=0; $i<$length; $i++){ $temp .= $cryptArray[$string[$i]]; } return $temp; } function decryptit($string,$cryptArray){ $temp = ""; $length = strlen($string); $cryptArray = array_flip($cryptArray); for($i =0; $i<$length; $i = $i+3){ $temp .= $cryptArray[$string[$i].$string[$i+1].$string[$i+2]]; } return $temp; } $crypted = cryptit($string,$cryptArray); echo $crypted; $decrypted = decryptit($crypted,$cryptArray); echo $decrypted;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/chR2A
function name:  (null)
number of ops:  15
compiled vars:  !0 = $cryptArray, !1 = $string, !2 = $crypted, !3 = $decrypted
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, 'aab'
   31     2        INIT_FCALL                                               'cryptit'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        DO_FCALL                                      0  $6      
          6        ASSIGN                                                   !2, $6
   32     7        ECHO                                                     !2
   34     8        INIT_FCALL                                               'decryptit'
          9        SEND_VAR                                                 !2
         10        SEND_VAR                                                 !0
         11        DO_FCALL                                      0  $8      
         12        ASSIGN                                                   !3, $8
   35    13        ECHO                                                     !3
   43    14      > RETURN                                                   1

Function cryptit:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 7
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 7
Branch analysis from position: 13
Branch analysis from position: 7
filename:       /in/chR2A
function name:  cryptit
number of ops:  15
compiled vars:  !0 = $string, !1 = $cryptArray, !2 = $temp, !3 = $length, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2        ASSIGN                                                   !2, ''
    9     3        STRLEN                                           ~6      !0
          4        ASSIGN                                                   !3, ~6
   10     5        ASSIGN                                                   !4, 0
          6      > JMP                                                      ->11
   11     7    >   FETCH_DIM_R                                      ~9      !0, !4
          8        FETCH_DIM_R                                      ~10     !1, ~9
          9        ASSIGN_OP                                     8          !2, ~10
   10    10        PRE_INC                                                  !4
         11    >   IS_SMALLER                                               !4, !3
         12      > JMPNZ                                                    ~13, ->7
   15    13    > > RETURN                                                   !2
   17    14*     > RETURN                                                   null

End of function cryptit

Function decryptit:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 11
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 11
Branch analysis from position: 24
Branch analysis from position: 11
filename:       /in/chR2A
function name:  decryptit
number of ops:  26
compiled vars:  !0 = $string, !1 = $cryptArray, !2 = $temp, !3 = $length, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   20     2        ASSIGN                                                   !2, ''
   21     3        STRLEN                                           ~6      !0
          4        ASSIGN                                                   !3, ~6
   22     5        INIT_FCALL                                               'array_flip'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $8      
          8        ASSIGN                                                   !1, $8
   23     9        ASSIGN                                                   !4, 0
         10      > JMP                                                      ->22
   25    11    >   FETCH_DIM_R                                      ~11     !0, !4
         12        ADD                                              ~12     !4, 1
         13        FETCH_DIM_R                                      ~13     !0, ~12
         14        CONCAT                                           ~14     ~11, ~13
         15        ADD                                              ~15     !4, 2
         16        FETCH_DIM_R                                      ~16     !0, ~15
         17        CONCAT                                           ~17     ~14, ~16
         18        FETCH_DIM_R                                      ~18     !1, ~17
         19        ASSIGN_OP                                     8          !2, ~18
   23    20        ADD                                              ~20     !4, 3
         21        ASSIGN                                                   !4, ~20
         22    >   IS_SMALLER                                               !4, !3
         23      > JMPNZ                                                    ~22, ->11
   28    24    > > RETURN                                                   !2
   29    25*     > RETURN                                                   null

End of function decryptit

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.81 ms | 1407 KiB | 17 Q