[php-src] master: standard: Define `PASSWORD_DEFAULT` in terms of `PASSWORD_BCRYPT` (#24078)
| From: | Tim Düsterhus via GitHub | Date: | Fri, 02 Oct 2026 18:31:33 +0000 |
| Subject: | [php-src] master: standard: Define `PASSWORD_DEFAULT` in terms of `PASSWORD_BCRYPT` (#24078) | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-141893@lists.php.net to get a copy of this message | ||
Author: Tim Düsterhus (TimWolla)
Committer: GitHub (web-flow)
Pusher: TimWolla
Date: 2026-10-02T20:31:29+02:00
Commit: https://github.com/php/php-src/commit/9696705fb135e28aaa7bb2bf650b3e8ac1fa1a8e
Raw diff: https://github.com/php/php-src/commit/9696705fb135e28aaa7bb2bf650b3e8ac1fa1a8e.diff
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.
Changed paths:
M ext/standard/password.stub.php
M ext/standard/password_arginfo.h
Diff:
diff --git a/ext/standard/password.stub.php b/ext/standard/password.stub.php
index b4758ef54b12..98c78032c9f8 100644
--- a/ext/standard/password.stub.php
+++ b/ext/standard/password.stub.php
@@ -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_THREADS = UNKNOWN;
#endif
+
+/** @var string */
+const PASSWORD_DEFAULT = PASSWORD_BCRYPT;
diff --git a/ext/standard/password_arginfo.h b/ext/standard/password_arginfo.h
index 2a7b19f6108a..bbfe8d16aa37 100644
--- a/ext/standard/password_arginfo.h
+++ b/ext/standard/password_arginfo.h
@@ -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);
}