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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
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

Pull Requests

Pull requests:

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: Sat Dec 21 14:01:32 2024 UTC