Skip to content

hash_file() appears to be restricted to 3 arguments  #11180

Closed
ThePHPF/thephp.foundation
#90
@maecompany

Description

@maecompany

Description

According to hash_file(), the function takes in 4 arguments, the latest one being an $options array, however it does not seem to accept 4 arguments.

The following code:

<?php echo hash_file('md5', '/dev/null', false, []); ?>

Resulted in this output:

PHP Fatal error:  Uncaught ArgumentCountError: hash_file() expects at most 3 arguments, 4 given

But I expected this output instead:

... some hash

Shouldn't the ZEND_PARSE_PARAMETERS_START(2, 3) actually be ZEND_PARSE_PARAMETERS_START(2, 4) here:

ZEND_PARSE_PARAMETERS_START(2, 3)
?

PHP Version

PHP 8.1.18

Operating System

Ubuntu 23.04

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions