php.net |  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
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


Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-08-13 12:49 UTC] cmb@php.net
-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:  https://github.com/php/php-src/pull/5995
Patch:      https://github.com/php/php-src/pull/5995.patch
 [2020-09-23 10:28 UTC] nikic@php.net
-Status: Verified +Status: Closed -Assigned To: +Assigned To: nikic
 [2020-09-23 10:28 UTC] nikic@php.net
This has been fixed in PHP 8, and I don't think it's worthwhile to fix in earlier versions.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 20:01:31 2024 UTC