[php-src] Issue #11180: hash_file() appears to be restricted to 3 arguments

From: Date: Tue, 02 May 2023 16:48:43 +0000
Subject: [php-src] Issue #11180: hash_file() appears to be restricted to 3 arguments
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-244344@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/11180 Author: maecompany ### Description According to [hash_file()](https://www.php.net/manual/en/function.hash-file.php), 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 <?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: https://github.com/php/php-src/blob/0e5ac62f4eb310032a2ad65ea2c008e1981ddad3/ext/hash/hash.c#L453 ? ### PHP Version PHP 8.1.18 ### Operating System Ubuntu 23.04

« previous php.bugs (#244344) next »