|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43512 same parameter name can be used multiple times in method/function definition
Submitted: 2007-12-06 09:08 UTC Modified: 2011-02-18 00:25 UTC
Avg. Score:4.6 ± 1.0
Reproduced:7 of 8 (87.5%)
Same Version:2 (28.6%)
Same OS:2 (28.6%)
From: alkoholex at gmail dot com Assigned: felipe (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: * OS: *
Private report: No CVE-ID: None
 [2007-12-06 09:08 UTC] alkoholex at gmail dot com
The PHP-Parser doesn't recognise if a parameter with the same name is given over two times (no warning / error). In this case it was a copy-paste mistake, but it causes big troubles in our system.

Reproduce code:
class myCls extends otherCls {

     private function myFunc($var, $var) {
	//do something		

Expected result:
A Warning should occur. Something like "Multible use of variable/parameter name in function myFunc".

Actual result:
Nothing. The second parameter replaces the value of the first.
If you don't give over an second parameter, the value of the first is nonsence or empty.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-12-12 10:28 UTC]
Good catch. I can reproduce this with any current CVS/released versions.
 [2010-12-31 23:54 UTC]
-Type: Feature/Change Request +Type: Bug -Package: Feature/Change Request +Package: Scripting Engine problem -Operating System: Linux Debian 4.0 +Operating System: * -PHP Version: 5.2.5, 5.3CVS, 6CVS +PHP Version: *
 [2011-02-18 00:24 UTC]
Automatic comment from SVN on behalf of felipe
Log: - Fixed bug #43512 (same parameter name can be used multiple times in method/function definition)
 [2011-02-18 00:25 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: felipe
 [2011-02-18 00:25 UTC]
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 23 16:01:29 2024 UTC