3v4l.org

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

End of function password_verify_with_rehash

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.76 ms | 1403 KiB | 22 Q