3v4l.org

run code in 300+ PHP versions simultaneously
<?php class security { private function addSalt($pass) { $salt1='abcdefghijkl'; //OUR FIRST 12 CHAR SALT $salt2='opqrstuvwxyz'; //OUR 2ND 12 CHAR SALT $md5 = (md5($pass)); $hash1 = $salt1.$md5.$salt2;// SALT1-MD5-SALT2 COMBINED $hash2 = strrev($hash1); //WE FLIP-REVERSE THE HASH return $hash2;//CHANGE TO RETURN }//end func private function unSalt($pass2) { $a1 = substr($pass2, -44); // WE STRIP THE FIRST 12 CHAR SALT $b1 = strrev($a1); //WE UN-FLIP THE HASH return substr($b1, -32); // WE FETCH OUR ORIGINAL MD5 AND STRIP THE 2ND SALT }//end func }//end class $h = ''; $sc = new security; for ($i = 0; $i < 100; ++$i) { echo $security->addSalt($i), "\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 6
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 6
Branch analysis from position: 14
Branch analysis from position: 6
filename:       /in/T0HKN
function name:  (null)
number of ops:  15
compiled vars:  !0 = $h, !1 = $sc, !2 = $i, !3 = $security
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   ASSIGN                                                   !0, ''
   26     1        NEW                                              $5      'security'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $5
   27     4        ASSIGN                                                   !2, 0
          5      > JMP                                                      ->12
   28     6    >   INIT_METHOD_CALL                                         !3, 'addSalt'
          7        SEND_VAR_EX                                              !2
          8        DO_FCALL                                      0  $9      
          9        ECHO                                                     $9
         10        ECHO                                                     '%0A'
   27    11        PRE_INC                                                  !2
         12    >   IS_SMALLER                                               !2, 100
         13      > JMPNZ                                                    ~11, ->6
   29    14    > > RETURN                                                   1

Class security:
Function addsalt:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/T0HKN
function name:  addSalt
number of ops:  16
compiled vars:  !0 = $pass, !1 = $salt1, !2 = $salt2, !3 = $md5, !4 = $hash1, !5 = $hash2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        ASSIGN                                                   !1, 'abcdefghijkl'
    9     2        ASSIGN                                                   !2, 'opqrstuvwxyz'
   10     3        INIT_FCALL                                               'md5'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $8      
          6        ASSIGN                                                   !3, $8
   11     7        CONCAT                                           ~10     !1, !3
          8        CONCAT                                           ~11     ~10, !2
          9        ASSIGN                                                   !4, ~11
   12    10        INIT_FCALL                                               'strrev'
         11        SEND_VAR                                                 !4
         12        DO_ICALL                                         $13     
         13        ASSIGN                                                   !5, $13
   13    14      > RETURN                                                   !5
   14    15*     > RETURN                                                   null

End of function addsalt

Function unsalt:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/T0HKN
function name:  unSalt
number of ops:  16
compiled vars:  !0 = $pass2, !1 = $a1, !2 = $b1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   18     1        INIT_FCALL                                               'substr'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 -44
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
   19     6        INIT_FCALL                                               'strrev'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $5      
          9        ASSIGN                                                   !2, $5
   20    10        INIT_FCALL                                               'substr'
         11        SEND_VAR                                                 !2
         12        SEND_VAL                                                 -32
         13        DO_ICALL                                         $7      
         14      > RETURN                                                   $7
   21    15*     > RETURN                                                   null

End of function unsalt

End of class security.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.3 ms | 1400 KiB | 19 Q