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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: david at grudl dot com
New email:
PHP Version: OS:

 

 [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-2020 The PHP Group
All rights reserved.
Last updated: Mon Oct 26 05:01:24 2020 UTC