3v4l.org

run code in 300+ PHP versions simultaneously
<?php function generatePassword($username, $password ) { /* 1. RESULT = LOWER_CASE ( username ) + PASSWORD 2. RESULT = LOWER_CASE ( SHA1_HEX(RESULT) ) 3. RESULT = SESSIONID + RESULT 4. RESULT = UPPER_CASE ( SHA1_HEX(RESULT) ) */ $this->_sessionid = 'GEW4JHV7H7JOR5IV868R'; if( $this->_sessionid ) { //1. $result = strtolower( $username ) . $password; //2. $result = strtolower( sha1( $result ) ); //3. $result = $this->_sessionid . $result; //4. $result = strtoupper( sha1( $result ) ); } else { $result = false; } return $result; } print_r(generatePassword('599750531', '4321')); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bftQr
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   INIT_FCALL                                               'print_r'
          1        INIT_FCALL                                               'generatepassword'
          2        SEND_VAL                                                 '599750531'
          3        SEND_VAL                                                 '4321'
          4        DO_FCALL                                      0  $0      
          5        SEND_VAR                                                 $0
          6        DO_ICALL                                                 
   30     7      > RETURN                                                   1

Function generatepassword:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 32
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bftQr
function name:  generatePassword
number of ops:  35
compiled vars:  !0 = $username, !1 = $password, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   10     2        FETCH_THIS                                       $3      
          3        ASSIGN_OBJ                                               $3, '_sessionid'
          4        OP_DATA                                                  'GEW4JHV7H7JOR5IV868R'
   11     5        FETCH_THIS                                       $5      
          6        FETCH_OBJ_R                                      ~6      $5, '_sessionid'
          7      > JMPZ                                                     ~6, ->32
   14     8    >   INIT_FCALL                                               'strtolower'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $7      
         11        CONCAT                                           ~8      $7, !1
         12        ASSIGN                                                   !2, ~8
   16    13        INIT_FCALL                                               'strtolower'
         14        INIT_FCALL                                               'sha1'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                         $10     
         17        SEND_VAR                                                 $10
         18        DO_ICALL                                         $11     
         19        ASSIGN                                                   !2, $11
   18    20        FETCH_THIS                                       $13     
         21        FETCH_OBJ_R                                      ~14     $13, '_sessionid'
         22        CONCAT                                           ~15     ~14, !2
         23        ASSIGN                                                   !2, ~15
   20    24        INIT_FCALL                                               'strtoupper'
         25        INIT_FCALL                                               'sha1'
         26        SEND_VAR                                                 !2
         27        DO_ICALL                                         $17     
         28        SEND_VAR                                                 $17
         29        DO_ICALL                                         $18     
         30        ASSIGN                                                   !2, $18
         31      > JMP                                                      ->33
   23    32    >   ASSIGN                                                   !2, <false>
   25    33    > > RETURN                                                   !2
   26    34*     > RETURN                                                   null

End of function generatepassword

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.7 ms | 1402 KiB | 22 Q