Skip to content

Commit 9c3b7cc

Browse files
TysonAndrenikic
authored andcommitted
Fix opcache return type for hash_update_stream
It can return false if the resource type is wrong. ``` php > var_export(hash_update_stream(hash_init('md5'), imagecreate(1,1))); Warning: hash_update_stream(): supplied resource is not a valid stream resource in php shell code on line 1 false ``` The return types were initially added in c88ffa9
1 parent cd63908 commit 9c3b7cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/opcache/Optimizer/zend_func_info.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,7 @@ static const func_info_t func_infos[] = {
11921192
F1("hash_hmac_file", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
11931193
F1("hash_init", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_OBJECT),
11941194
F0("hash_update", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
1195-
F0("hash_update_stream", MAY_BE_NULL | MAY_BE_LONG),
1195+
F0("hash_update_stream", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
11961196
F0("hash_update_file", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
11971197
F1("hash_final", MAY_BE_NULL | MAY_BE_STRING),
11981198
F1("hash_copy", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_OBJECT),

0 commit comments

Comments
 (0)