3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* nul byte (\u0000) safe password hashing function based on password_hash (uses "bcrypt" algorithm). * Source : https://paragonie.com/blog/2016/02/how-safely-store-password-in-2016 by CiPHPCoder * Code: @Florent_ATo */ function safePasswordHash($password) { return password_hash( base64_encode( hash('sha384', $password, false) ), PASSWORD_BCRYPT, array('cost' => 12) ); } $password = '*********password-longer-than-72-characters-and-with-\0-sequence*********'; print safePasswordHash($password); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/R1ccr
function name:  (null)
number of ops:  6
compiled vars:  !0 = $password
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ASSIGN                                                   !0, '%2A%2A%2A%2A%2A%2A%2A%2A%2Apassword-longer-than-72-characters-and-with-%5C0-sequence%2A%2A%2A%2A%2A%2A%2A%2A%2A'
   15     1        INIT_FCALL                                               'safepasswordhash'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
   17     5      > RETURN                                                   1

Function safepasswordhash:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/R1ccr
function name:  safePasswordHash
number of ops:  16
compiled vars:  !0 = $password
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        INIT_FCALL                                               'password_hash'
    8     2        INIT_FCALL                                               'base64_encode'
    9     3        INIT_FCALL                                               'hash'
          4        SEND_VAL                                                 'sha384'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 <false>
          7        DO_ICALL                                         $1      
          8        SEND_VAR                                                 $1
          9        DO_ICALL                                         $2      
         10        SEND_VAR                                                 $2
   10    11        SEND_VAL                                                 '2y'
         12        SEND_VAL                                                 <array>
         13        DO_ICALL                                         $3      
         14      > RETURN                                                   $3
   12    15*     > RETURN                                                   null

End of function safepasswordhash

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.42 ms | 1398 KiB | 20 Q