Bug #78885 [Opn]: hash_file now shows a notice for directories and returns false
| From: | cmb@php.net | Date: | Fri, 29 Nov 2019 12:34:44 +0000 |
| Subject: | Bug #78885 [Opn]: hash_file now shows a notice for directories and returns false | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-223941@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78885&edit=1
ID: 78885
Updated by: cmb@php.net
Reported by: php-bugs at xpaw dot me
Summary: hash_file now shows a notice for directories and
returns false
Status: Open
Type: Bug
-Package: hash
+Package: Filesystem function related
Operating System: Linux
PHP Version: 7.4.0
Block user comment: N
Private report: N
New Comment:
This is not particularly related to hash_file(), but also affects
other filesystem functions, see <https://3v4l.org/5XQB3>.
IIRC,
that was a very deliberate change/fix.
Previous Comments:
------------------------------------------------------------------------
[2019-11-29 10:57:37] php-bugs at xpaw dot me
Description:
------------
See https://3v4l.org/58RgW
Until 7.4.0beta1, it returned string(32) "d41d8cd98f00b204e9800998ecf8427e" and since
7.4.0beta2 it displays a notice.
Notice: hash_file(): read of 8192 bytes failed with errno=21 Is a directory in /in/58RgW on line 3
On Windows there is no notice, and it only returns false. I'm only creating this issue as I
don't see anything in upgrading notes, deprecated features or the changelog about it.
Test script:
---------------
<?php
var_dump( hash_file( 'md5', '/etc/' ) );
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78885&edit=1