Bug #78052 [Com]: exif_read_data chokes on strict_types for parameter 2
| From: | spam2 at rhsoft dot net | Date: | Wed, 22 May 2019 19:19:56 +0000 |
| Subject: | Bug #78052 [Com]: exif_read_data chokes on strict_types for parameter 2 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-220950@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78052&edit=1
ID: 78052
Comment by: spam2 at rhsoft dot net
Reported by: c dot schiffler at cyberspectrum dot de
Summary: exif_read_data chokes on strict_types for parameter
2
Status: Open
Type: Bug
Package: EXIF related
Operating System: Linux
PHP Version: 7.3.5
Block user comment: N
Private report: N
New Comment:
param 2 is type string . period
exif_read_data ( mixed $stream [, string $sections = NULL [, bool $arrays = FALSE [, bool $thumbnail
= FALSE ]]] ) : array
Previous Comments:
------------------------------------------------------------------------
[2019-05-22 19:10:51] c dot schiffler at cyberspectrum dot de
Description:
------------
Calling exif_read_data with null as second optional parameter results in a type error.
This results in impossibility to call exif_read_data having different values for parameter 3&4
but sticking to the null default of parameter 2.
Test script:
---------------
declare(strict_types=1);
// This errors out but should not.
exif_read_data('image.jpg', null, true, false);
// This is a workaround currently in use as internal functions are not affected by strict_types per
https://bugs.php.net/bug.php?id=74750
call_user_func('exif_read_data', 'image.jpg', null, true, false);
Expected result:
----------------
Data should be extracted.
Actual result:
--------------
TypeError: exif_read_data() expects parameter 2 to be string, null given
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78052&edit=1