Bug #54310 [Opn]: Class Method & Function Arguments are allowed to be named the same

From: Date: Sun, 29 Mar 2015 04:11:04 +0000
Subject: Bug #54310 [Opn]: Class Method & Function Arguments are allowed to be named the same
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191675@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=54310&edit=1 ID: 54310 Updated by: kalle@php.net Reported by: nicholas dot j dot miller at gmail dot com Summary: Class Method & Function Arguments are allowed to be named the same Status: Open Type: Bug -Package: *Compile Issues +Package: Scripting Engine problem Operating System: ANY PHP Version: 5.3.6 Block user comment: N Private report: N New Comment: Fixed category Previous Comments: ------------------------------------------------------------------------ [2011-03-22 13:23:17] felipe@php.net What has been treated in bug #43512 was a memory issue. And it was fixed. ------------------------------------------------------------------------ [2011-03-22 13:16:50] jinmoku at hotmail dot com see http://bugs.php.net/bug.php?id=43512 ------------------------------------------------------------------------ [2011-03-19 03:59:22] nicholas dot j dot miller at gmail dot com Description: ------------ When writing class method and function declarations, php allows multiple parameters with the same name. This seems like something that should produce a warning or notice. Test script: --------------- class Foo { public function bar($param, $param) { echo $param; } } $foo = new Foo(); $foo->bar('param1', 'param2'); Expected result: ---------------- I feel as though this should produce a warning or notice. Actual result: -------------- Runs without any issues and echos 'param2' ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=54310&edit=1

« previous php.bugs (#191675) next »