|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79969 Wrong error message in strict mode
Submitted: 2020-08-13 12:35 UTC Modified: 2020-09-23 10:28 UTC
From: david at grudl dot com Assigned: nikic (profile)
Status: Closed Package: Reflection related
PHP Version: 7.3 OS:
Private report: No CVE-ID: None
 [2020-08-13 12:35 UTC] david at grudl dot com
This code new ReflectionMethod('xxx', 1) throws ArgumentCountError: "ReflectionMethod::__construct() expects exactly 1 parameter, 2 given", which is wrong.

Test script:

Expected result:
It should throw TypeError: ReflectionMethod::__construct(): Argument #2 ($method) must be of type string, int given


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-08-13 12:49 UTC]
-Status: Open +Status: Verified -PHP Version: 7.4.9 +PHP Version: 7.3
 [2020-08-16 05:41 UTC] 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:
 [2020-09-23 10:28 UTC]
-Status: Verified +Status: Closed -Assigned To: +Assigned To: nikic
 [2020-09-23 10:28 UTC]
This has been fixed in PHP 8, and I don't think it's worthwhile to fix in earlier versions.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Apr 20 17:01:23 2021 UTC