PHP BCrypt for Ruby on Rails Devise passwords
===

I am trying to verify with PHP some passwords generated by Devise Ruby on Rails.
Devise was configured to use bcrypt.

My code is:

    $database_record = "$2a$10$..."; // generated by devise
    $user_input = 'asdasd';
    $password = crypt($user_input, '$2a$10$usesomesillystringforsalt$');
    
    if (crypt($user_input, $database_record) == $password) {
        echo "<br/>Password verified!";
    }
    else {
        echo '<br/>failed!'; }


The documentation that I saw are using this method, but it doesn't work for me. Am I forgetting something?
The "pepper string" should be used in any way?
Thanks!