Req #78257 [NEW]: default arguments by reference don't work
From: amillanir1991 at gmail dot com
Operating system: Windows 7 64 bits
PHP version: 7.3Git-2019-07-05 (snap)
Package: *Compile Issues
Bug Type: Feature/Change Request
Bug description:default arguments by reference don't work
Description:
------------
function that recieve default arguments by reference don´t work, php
version 7.3.6 exactly.
Test script:
---------------
//Don´t work
$arr = [10];
function asign(&..$arr){
$arr[0] = 100;
}
asign($arr);
echo "<br> $arr[0]";
//Work
$arr = [10];
function asign(&$arr){
$arr[0] = 100;
}
asign($arr);
echo "<br> $arr[0]";
Expected result:
----------------
that the value changed into function
Actual result:
--------------
it shows nothing on the screen, not even a warning ...
--
Edit bug report at https://bugs.php.net/bug.php?id=78257&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=78257&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=78257&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=78257&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=78257&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=78257&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=78257&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=78257&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=78257&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=78257&r=support
Expected behavior: https://bugs.php.net/fix.php?id=78257&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=78257&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=78257&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=78257&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=78257&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=78257&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=78257&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=78257&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=78257&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=78257&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=78257&r=mysqlcfg
Thread (4 messages)
- amillanir1991 at gmail dot com