How can PHP 8 be configured to deliver the same output as PHP 5-7 for the crypt function?

PHP 8 introduced changes to the crypt function that may result in different output compared to PHP 5-7 due to the default algorithm being changed to bcrypt. To configure PHP 8 to deliver the same output as PHP 5-7 for the crypt function, you can specify the algorithm parameter as 1 to use the MD5 algorithm, which was the default in PHP 5-7.

// Configure PHP 8 to deliver the same output as PHP 5-7 for the crypt function
$password = 'password';
$salt = '$2a$07$usesomesillystringforsalt$';
$hashedPassword = crypt($password, $salt, 1); // Use MD5 algorithm
echo $hashedPassword;