Bug #79969 [Ver->Csd]: Wrong error message in strict mode
Edit report at https://bugs.php.net/bug.php?id=79969&edit=1
ID: 79969
Updated by: nikic@php.net
Reported by: david at grudl dot com
Summary: Wrong error message in strict mode
-Status: Verified
+Status: Closed
Type: Bug
Package: Reflection related
PHP Version: 7.3
-Assigned To:
+Assigned To: nikic
Block user comment: N
Private report: N
New Comment:
This has been fixed in PHP 8, and I don't think it's worthwhile to fix in earlier
versions.
Previous Comments:
------------------------------------------------------------------------
[2020-08-16 05:41:47] jdomenechbborges at gmail dot com
The following pull request has been associated:
Patch Name: Fix #79969: Wrong error message in strict mode in ReflectionMethod::_construct
On GitHub: https://github.com/php/php-src/pull/5995
Patch: https://github.com/php/php-src/pull/5995.patch
------------------------------------------------------------------------
[2020-08-13 12:35:37] david at grudl dot com
Description:
------------
This code new ReflectionMethod('xxx', 1) throws ArgumentCountError:
"ReflectionMethod::__construct() expects exactly 1 parameter, 2 given", which is wrong.
Test script:
---------------
https://3v4l.org/Yvsgk
Expected result:
----------------
It should throw TypeError: ReflectionMethod::__construct(): Argument #2 ($method) must be of type
string, int given
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79969&edit=1
Thread (4 messages)