3v4l.org

run code in 300+ PHP versions simultaneously
<?php function password_verify_with_rehash($password, $hash) { if (!password_verify($password, $hash)) { return 'badpass'; } if (password_needs_rehash($hash, PASSWORD_DEFAULT)) { $hash = password_hash($password, PASSWORD_DEFAULT); return 'rehash'; } return 'allgood'; } $password = 'thisIsABadPassword'; $hash = password_hash($password, PASSWORD_DEFAULT); echo $hash; $passwordTry = 'thisIsABadPasswordAndWrong'; var_dump(password_verify_with_rehash($passwordTry, $hash));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LLe9c
function name:  (null)
number of ops:  16
compiled vars:  !0 = $password, !1 = $hash, !2 = $passwordTry
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ASSIGN                                                   !0, 'thisIsABadPassword'
   18     1        INIT_FCALL                                               'password_hash'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '2y'
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
   19     6        ECHO                                                     !1
   21     7        ASSIGN                                                   !2, 'thisIsABadPasswordAndWrong'
   23     8        INIT_FCALL                                               'var_dump'
          9        INIT_FCALL                                               'password_verify_with_rehash'
         10        SEND_VAR                                                 !2
         11        SEND_VAR                                                 !1
         12        DO_FCALL                                      0  $7      
         13        SEND_VAR                                                 $7
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Function password_verify_with_rehash:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 20
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LLe9c
function name:  password_verify_with_rehash
number of ops:  22
compiled vars:  !0 = $password, !1 = $hash
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL                                               'password_verify'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $2      
          6        BOOL_NOT                                         ~3      $2
          7      > JMPZ                                                     ~3, ->9
    5     8    > > RETURN                                                   'badpass'
    8     9    >   INIT_FCALL                                               'password_needs_rehash'
         10        SEND_VAR                                                 !1
         11        SEND_VAL                                                 '2y'
         12        DO_ICALL                                         $4      
         13      > JMPZ                                                     $4, ->20
    9    14    >   INIT_FCALL                                               'password_hash'
         15        SEND_VAR                                                 !0
         16        SEND_VAL                                                 '2y'
         17        DO_ICALL                                         $5      
         18        ASSIGN                                                   !1, $5
   11    19      > RETURN                                                   'rehash'
   14    20    > > RETURN                                                   'allgood'
   15    21*     > RETURN                                                   null

End of function password_verify_with_rehash

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.82 ms | 1402 KiB | 22 Q