3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Note that the salt here is randomly generated. * Never use a static salt or one that is not randomly generated. * * For the VAST majority of use-cases, let password_hash generate the salt randomly for you */ $options = [ 'cost' => 11, 'salt' => mcrypt_create_iv(256, MCRYPT_DEV_URANDOM), ]; $hash = password_hash("rasmuslerdorf", PASSWORD_BCRYPT, $options)."\n"; $verify = password_verify("rasmuslerdorf",$hash); print_r( [ "hash" => $hash, "verify" => $verify ]); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qdsgD
function name:  (null)
number of ops:  26
compiled vars:  !0 = $options, !1 = $hash, !2 = $verify
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_ARRAY                                       ~3      11, 'cost'
   10     1        INIT_FCALL_BY_NAME                                       'mcrypt_create_iv'
          2        SEND_VAL_EX                                              256
          3        FETCH_CONSTANT                                   ~4      'MCRYPT_DEV_URANDOM'
          4        SEND_VAL_EX                                              ~4
          5        DO_FCALL                                      0  $5      
          6        ADD_ARRAY_ELEMENT                                ~3      $5, 'salt'
    8     7        ASSIGN                                                   !0, ~3
   12     8        INIT_FCALL                                               'password_hash'
          9        SEND_VAL                                                 'rasmuslerdorf'
         10        SEND_VAL                                                 '2y'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $7      
         13        CONCAT                                           ~8      $7, '%0A'
         14        ASSIGN                                                   !1, ~8
   14    15        INIT_FCALL                                               'password_verify'
         16        SEND_VAL                                                 'rasmuslerdorf'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $10     
         19        ASSIGN                                                   !2, $10
   16    20        INIT_FCALL                                               'print_r'
   17    21        INIT_ARRAY                                       ~12     !1, 'hash'
   18    22        ADD_ARRAY_ELEMENT                                ~12     !2, 'verify'
         23        SEND_VAL                                                 ~12
         24        DO_ICALL                                                 
   20    25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.11 ms | 1400 KiB | 19 Q