3v4l.org

run code in 300+ PHP versions simultaneously
<?php // $2a$12$BMxrzFUgKhjg3KYLUxQH7.ewjXzBUiy7MmIICALXHlOYudsAFQnGa $hash = crypt('falcon', '$2a$12$BMxrzFUgKhjg3KYLUxQH7K'); var_dump($hash == crypt('falcon', $hash)); var_dump($hash == '$2a$12$BMxrzFUgKhjg3KYLUxQH7.ewjXzBUiy7MmIICALXHlOYudsAFQnGa'); /* $salt = substr(str_replace('+', '.', base64_encode(sha1(microtime(true), true))), 0, 22); // 2a is the bcrypt algorithm selector, see http://php.net/crypt // 12 is the workload factor (around 300ms on my Core i7 machine), see http://php.net/crypt echo $hash = crypt('falcon', '$2a$12$' . $salt); var_dump('$2a$12$' . $salt); // we can now use the generated hash as the argument to crypt(), since it too will contain $a2$12$... with a variation of the hash. No need to store the salt anymore, just the hash is enough! var_dump($hash == crypt('foo', $hash)); // true var_dump($hash == crypt('falcon', $hash)); // false */
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p6snm
function name:  (null)
number of ops:  18
compiled vars:  !0 = $hash
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'crypt'
          1        SEND_VAL                                                 'falcon'
          2        SEND_VAL                                                 '%242a%2412%24BMxrzFUgKhjg3KYLUxQH7K'
          3        DO_ICALL                                         $1      
          4        ASSIGN                                                   !0, $1
    5     5        INIT_FCALL                                               'var_dump'
          6        INIT_FCALL                                               'crypt'
          7        SEND_VAL                                                 'falcon'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $3      
         10        IS_EQUAL                                         ~4      !0, $3
         11        SEND_VAL                                                 ~4
         12        DO_ICALL                                                 
    8    13        INIT_FCALL                                               'var_dump'
         14        IS_EQUAL                                         ~6      !0, '%242a%2412%24BMxrzFUgKhjg3KYLUxQH7.ewjXzBUiy7MmIICALXHlOYudsAFQnGa'
         15        SEND_VAL                                                 ~6
         16        DO_ICALL                                                 
   24    17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.22 ms | 1410 KiB | 17 Q