Skip to content

Incorrect return types for hash() and hash_hmac() #7759

Closed
@jlherren

Description

@jlherren

Description

I believe the stub file entries for hash() and hash_hmac() to be incorrect. Their return types are both specified as string|false, but starting with PHP 8.0 they in fact never return false, they throw a fatal error where they returned false before PHP 8.0. In the case of hash() the only two RETURN_FALSE statements (1, 2) are within if (isfilename)blocks, e.g. the code path used exclusively by hash_file(). It's similar for hash_hmac().

Does that make sense or did I miss something?

PHP Version

PHP >= 8.0

Operating System

All OSes

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions