3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pass = 'secret'; $salt = '$2y$07$usesomesillystringforsalt$'; $hash = crypt($pass, $salt); var_dump( $hash, str_split($hash) // the 22th salt character 'e' is on index 28 ); function meow($char) { $hash = crypt('secret', '$2y$04$usesomesillystringfor' . $char); $char = substr($hash, 28, 1); $dec = ord($char); $bin = decbin($dec); var_dump( $hash, $char, $dec, $bin, decbin(ord($char)) ); } $alphabet = str_split('abcdefghijklmnopqrstuvwxyz'); foreach($alphabet as $char) { meow($char); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 24
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 24
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/1l1u4
function name:  (null)
number of ops:  26
compiled vars:  !0 = $pass, !1 = $salt, !2 = $hash, !3 = $alphabet, !4 = $char
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'secret'
    4     1        ASSIGN                                                   !1, '%242y%2407%24usesomesillystringforsalt%24'
    5     2        INIT_FCALL                                               'crypt'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $7      
          6        ASSIGN                                                   !2, $7
    7     7        INIT_FCALL                                               'var_dump'
    8     8        SEND_VAR                                                 !2
    9     9        INIT_FCALL                                               'str_split'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                         $9      
         12        SEND_VAR                                                 $9
         13        DO_ICALL                                                 
   27    14        INIT_FCALL                                               'str_split'
         15        SEND_VAL                                                 'abcdefghijklmnopqrstuvwxyz'
         16        DO_ICALL                                         $11     
         17        ASSIGN                                                   !3, $11
   29    18      > FE_RESET_R                                       $13     !3, ->24
         19    > > FE_FETCH_R                                               $13, !4, ->24
   30    20    >   INIT_FCALL                                               'meow'
         21        SEND_VAR                                                 !4
         22        DO_FCALL                                      0          
   29    23      > JMP                                                      ->19
         24    >   FE_FREE                                                  $13
   31    25      > RETURN                                                   1

Function meow:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1l1u4
function name:  meow
number of ops:  35
compiled vars:  !0 = $char, !1 = $hash, !2 = $dec, !3 = $bin
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        INIT_FCALL                                               'crypt'
          2        SEND_VAL                                                 'secret'
          3        CONCAT                                           ~4      '%242y%2404%24usesomesillystringfor', !0
          4        SEND_VAL                                                 ~4
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !1, $5
   14     7        INIT_FCALL                                               'substr'
          8        SEND_VAR                                                 !1
          9        SEND_VAL                                                 28
         10        SEND_VAL                                                 1
         11        DO_ICALL                                         $7      
         12        ASSIGN                                                   !0, $7
   15    13        INIT_FCALL                                               'ord'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $9      
         16        ASSIGN                                                   !2, $9
   16    17        INIT_FCALL                                               'decbin'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                         $11     
         20        ASSIGN                                                   !3, $11
   18    21        INIT_FCALL                                               'var_dump'
   19    22        SEND_VAR                                                 !1
   20    23        SEND_VAR                                                 !0
   21    24        SEND_VAR                                                 !2
   22    25        SEND_VAR                                                 !3
   23    26        INIT_FCALL                                               'decbin'
         27        INIT_FCALL                                               'ord'
         28        SEND_VAR                                                 !0
         29        DO_ICALL                                         $13     
         30        SEND_VAR                                                 $13
         31        DO_ICALL                                         $14     
         32        SEND_VAR                                                 $14
         33        DO_ICALL                                                 
   25    34      > RETURN                                                   null

End of function meow

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.04 ms | 1402 KiB | 26 Q