Req #73550 [NEW]: PHP Function Call Proposal
| From: | zartashzulfiqar at gmail dot com | Date: | Wed, 16 Nov 2016 22:32:50 +0000 |
| Subject: | Req #73550 [NEW]: PHP Function Call Proposal | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-205425@lists.php.net to get a copy of this message | ||
From: zartashzulfiqar at gmail dot com
Operating system: All
PHP version: 7.1.0RC6
Package: *General Issues
Bug Type: Feature/Change Request
Bug description:PHP Function Call Proposal
Description:
------------
function myFunction($var1, $var2=3, $var3=4, $var4=5) {
echo $var1."\n".$var2."\n".$var3."\n".$var4;
}
Test script:
---------------
myFunction('Test Call', 3, 4, 10);
Expected result:
----------------
I expect this Output:
Test Call
3
4
10
Actual result:
--------------
Actual Same:
Test Call
3
4
10
But Issue is:
Now see that I only want to change $var4 value in my function. All other
default values will remain same. But I have to remember every value and
pass it through the function.
I am proposing a this change like this:
myFunction('Default Value', $var4=10);
so that Every developer can only pass value with specific variable name.
This issue arises at many function when we used in our development. I
think this change will be a big feature for developer.
--
Edit bug report at https://bugs.php.net/bug.php?id=73550&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73550&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73550&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73550&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=73550&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=73550&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=73550&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=73550&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=73550&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=73550&r=support
Expected behavior: https://bugs.php.net/fix.php?id=73550&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=73550&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=73550&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=73550&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73550&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=73550&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=73550&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=73550&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73550&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=73550&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=73550&r=mysqlcfg