standard: Define PASSWORD_DEFAULT in terms of PASSWORD_BCRYPT (#24078)

Instead of copying the constant’s value, we can just refer to the constant,
making the stub more self-explanatory.
This commit is contained in:
Tim Düsterhus authored and GitHub committed 2026-10-02 20:31:29 +02:00
1 parent a8135c8021
commit 9696705fb1
2 files changed
+5 -3

No files matched your search

+3 -1
View File
@@ -2,7 +2,6 @@
/** @generate-class-entries */
const PASSWORD_DEFAULT = "2y";
const PASSWORD_BCRYPT = "2y";
/**
* @var int
@@ -30,3 +29,6 @@ const PASSWORD_ARGON2_DEFAULT_TIME_COST = UNKNOWN;
*/
const PASSWORD_ARGON2_DEFAULT_THREADS = UNKNOWN;
#endif
/** @var string */
const PASSWORD_DEFAULT = PASSWORD_BCRYPT;
+2 -2
View File
@@ -1,11 +1,10 @@
/* This is a generated file, edit password.stub.php instead.
* Stub hash: f61df8d477588718e0eb1b055e5a3e138e6bcad3 */
* Stub hash: 589ff98a8fd6883f11558d4984b89a0467e756e0 */
#include "zend_constants.h"
static void register_password_symbols(int module_number)
{
REGISTER_STRING_CONSTANT("PASSWORD_DEFAULT", "2y", CONST_PERSISTENT);
REGISTER_STRING_CONSTANT("PASSWORD_BCRYPT", "2y", CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PASSWORD_BCRYPT_DEFAULT_COST", PHP_PASSWORD_BCRYPT_COST, CONST_PERSISTENT);
#if defined(HAVE_ARGON2LIB)
@@ -16,4 +15,5 @@ static void register_password_symbols(int module_number)
REGISTER_LONG_CONSTANT("PASSWORD_ARGON2_DEFAULT_TIME_COST", PHP_PASSWORD_ARGON2_TIME_COST, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PASSWORD_ARGON2_DEFAULT_THREADS", PHP_PASSWORD_ARGON2_THREADS, CONST_PERSISTENT);
#endif
REGISTER_STRING_CONSTANT("PASSWORD_DEFAULT", "2y", CONST_PERSISTENT);
}