3v4l.org

run code in 300+ PHP versions simultaneously
<?php function genString($length = 22){ $s = ''; $chars = array_merge(range('A','Z'), range('a','z'), range(0,9)); while($length > 0){ $randKey = array_rand($chars, 1); $s .= $chars[$randKey]; $length--; } return $s; } $salt = '$2y$10$'.genString(); echo 'Salt: '.$salt.'<br>'; $password = 'M9KLpDJu70k39zlrUA5.2eK7UaYPLVKEfDvlxYCtHbgyhoA2bu/SO'; $hash = crypt($password, $salt); echo 'Hash: '.$hash.' -- Strlen: '.strlen($hash).'<br>'; //echo PHP_VERSION_ID.'<br>'; if (crypt($password, $hash) == $hash) { echo "Password verified!"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 26
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/re93e
function name:  (null)
number of ops:  27
compiled vars:  !0 = $salt, !1 = $password, !2 = $hash
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'genstring'
          1        DO_FCALL                                      0  $3      
          2        CONCAT                                           ~4      '%242y%2410%24', $3
          3        ASSIGN                                                   !0, ~4
   16     4        CONCAT                                           ~6      'Salt%3A+', !0
          5        CONCAT                                           ~7      ~6, '%3Cbr%3E'
          6        ECHO                                                     ~7
   18     7        ASSIGN                                                   !1, 'M9KLpDJu70k39zlrUA5.2eK7UaYPLVKEfDvlxYCtHbgyhoA2bu%2FSO'
   19     8        INIT_FCALL                                               'crypt'
          9        SEND_VAR                                                 !1
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $9      
         12        ASSIGN                                                   !2, $9
   21    13        CONCAT                                           ~11     'Hash%3A+', !2
         14        CONCAT                                           ~12     ~11, '+--+Strlen%3A+'
         15        STRLEN                                           ~13     !2
         16        CONCAT                                           ~14     ~12, ~13
         17        CONCAT                                           ~15     ~14, '%3Cbr%3E'
         18        ECHO                                                     ~15
   25    19        INIT_FCALL                                               'crypt'
         20        SEND_VAR                                                 !1
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                         $16     
         23        IS_EQUAL                                                 !2, $16
         24      > JMPZ                                                     ~17, ->26
   26    25    >   ECHO                                                     'Password+verified%21'
   27    26    > > RETURN                                                   1

Function genstring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 21
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 21
Branch analysis from position: 31
Branch analysis from position: 21
filename:       /in/re93e
function name:  genString
number of ops:  33
compiled vars:  !0 = $length, !1 = $s, !2 = $chars, !3 = $randKey
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV_INIT                                        !0      22
    4     1        ASSIGN                                                   !1, ''
    5     2        INIT_FCALL                                               'array_merge'
          3        INIT_FCALL                                               'range'
          4        SEND_VAL                                                 'A'
          5        SEND_VAL                                                 'Z'
          6        DO_ICALL                                         $5      
          7        SEND_VAR                                                 $5
          8        INIT_FCALL                                               'range'
          9        SEND_VAL                                                 'a'
         10        SEND_VAL                                                 'z'
         11        DO_ICALL                                         $6      
         12        SEND_VAR                                                 $6
         13        INIT_FCALL                                               'range'
         14        SEND_VAL                                                 0
         15        SEND_VAL                                                 9
         16        DO_ICALL                                         $7      
         17        SEND_VAR                                                 $7
         18        DO_ICALL                                         $8      
         19        ASSIGN                                                   !2, $8
    6    20      > JMP                                                      ->29
    7    21    >   INIT_FCALL                                               'array_rand'
         22        SEND_VAR                                                 !2
         23        SEND_VAL                                                 1
         24        DO_ICALL                                         $10     
         25        ASSIGN                                                   !3, $10
    8    26        FETCH_DIM_R                                      ~12     !2, !3
         27        ASSIGN_OP                                     8          !1, ~12
    9    28        PRE_DEC                                                  !0
    6    29    >   IS_SMALLER                                               0, !0
         30      > JMPNZ                                                    ~15, ->21
   11    31    > > RETURN                                                   !1
   12    32*     > RETURN                                                   null

End of function genstring

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.2 ms | 1394 KiB | 22 Q