#43512 [Opn]: two times the same parameter in a class-method

From: Date: Wed, 12 Dec 2007 10:28:49 +0000
Subject: #43512 [Opn]: two times the same parameter in a class-method
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-120601@lists.php.net to get a copy of this message
ID: 43512 Updated by: jani@php.net Reported By: alkoholex at gmail dot com Status: Open Bug Type: Scripting Engine problem Operating System: Linux Debian 4.0 PHP Version: 5.2.5, 5.3CVS, 6CVS New Comment: Good catch. I can reproduce this with any current CVS/released versions. Previous Comments: ------------------------------------------------------------------------ [2007-12-06 09:08:44] alkoholex at gmail dot com Description: ------------ 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. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43512&edit=1

« previous php.bugs (#120601) next »