Bug #69223 [NEW]: passing extra parameters in function/method call
| From: | php at w3x4 dot com | Date: | Wed, 11 Mar 2015 20:06:12 +0000 |
| Subject: | Bug #69223 [NEW]: passing extra parameters in function/method call | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-191321@lists.php.net to get a copy of this message | ||
From: php at w3x4 dot com
Operating system: W7 64
PHP version: 5.6.6
Package: Unknown/Other Function
Bug Type: Bug
Bug description:passing extra parameters in function/method call
Description:
------------
/* Using Visual Studio 2013 with Devsense PHP Tools, or
* Using UEStudio 15:
*
* 1) Set breakpoint on the 3 lines containing: $c=2
*
* 2) Examine Locals window to confirm that $a does not appear when a
static call or a function call passes more variables than the called
method/function expects.
*
* 3) Examine the error log to confirm that php does not throw an error
or report a warning.
*
* 4) Note that the existence of a reference to $a in Class Two results
in $a being displayed in the Locals window. Note also that removing
'$b=1' will result in $a being displayed in Locals window.
*
* I suggest that PHP should throw a fatal error when passing more
parameters than the function/method expects; it seems some other
(related) php problem is the cause of $a not being displayed in Locals
window.
*
*
* <SAA>
*/
Test script:
---------------
$xyz = new Class1;
class Class1 {
public function __construct() { $this->_callHook(); }
function _callHook(){
$ret = One::f1('a');
$ret = f1('b');
$ret = Two::f1('a');
}
}
class One{
static function f1(){ $a=1; $b=1;
$c=2;
}
}
function f1(){ $a=1; $b=1;
$c=2;
}
class Two{
static function f1(){ $a=1; $b=1;
$c=2; echo $a;
}
}
--
Edit bug report at https://bugs.php.net/bug.php?id=69223&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69223&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69223&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69223&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=69223&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=69223&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=69223&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=69223&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=69223&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=69223&r=support
Expected behavior: https://bugs.php.net/fix.php?id=69223&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=69223&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=69223&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=69223&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69223&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=69223&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=69223&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=69223&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69223&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=69223&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=69223&r=mysqlcfg