Skip to content

Commit bfbac70

Browse files
committed
Merge branch 'PHP-8.0'
* PHP-8.0: Don't return null from password_get_info()
2 parents 0d3ab67 + cec5e30 commit bfbac70

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

ext/standard/basic_functions.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1138,7 +1138,7 @@ function unpack(string $format, string $string, int $offset = 0): array|false {}
11381138

11391139
/* password.c */
11401140

1141-
function password_get_info(string $hash): ?array {}
1141+
function password_get_info(string $hash): array {}
11421142

11431143
function password_hash(string $password, string|int|null $algo, array $options = []): string {}
11441144

ext/standard/basic_functions_arginfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 7540039937587f05584660bc1a1a8a80aa5ccbd1 */
2+
* Stub hash: 4f4ed195a688735d48aeb3b7cd390d8463a07c26 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0)
55
ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0)
@@ -1750,7 +1750,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_unpack, 0, 2, MAY_BE_ARRAY|MAY_B
17501750
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0")
17511751
ZEND_END_ARG_INFO()
17521752

1753-
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_password_get_info, 0, 1, IS_ARRAY, 1)
1753+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_password_get_info, 0, 1, IS_ARRAY, 0)
17541754
ZEND_ARG_TYPE_INFO(0, hash, IS_STRING, 0)
17551755
ZEND_END_ARG_INFO()
17561756

ext/standard/password.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -584,11 +584,8 @@ PHP_FUNCTION(password_get_info)
584584
zend_string_release(ident);
585585

586586
add_assoc_string(return_value, "algoName", algo->name);
587-
if (algo->get_info &&
588-
(FAILURE == algo->get_info(&options, hash))) {
589-
zval_ptr_dtor_nogc(&options);
590-
zval_ptr_dtor_nogc(return_value);
591-
RETURN_NULL();
587+
if (algo->get_info) {
588+
algo->get_info(&options, hash);
592589
}
593590
add_assoc_zval(return_value, "options", &options);
594591
}

0 commit comments

Comments
 (0)