Bug #80522 [NEW]: Conflict in array name with implode
| From: | pl dot lamballais at flashover dot fr | Date: | Tue, 15 Dec 2020 22:29:17 +0000 |
| Subject: | Bug #80522 [NEW]: Conflict in array name with implode | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-231107@lists.php.net to get a copy of this message | ||
From: pl dot lamballais at flashover dot fr
Operating system: Lunix Debian
PHP version: 7.3.25
Package: Arrays related
Bug Type: Bug
Bug description:Conflict in array name with implode
Description:
------------
1) declare an array
2) use this array as return from a function
3) fill this array manually with values
4) implode the array
The first and second item are swapped in the result string
Test script:
---------------
$tab_ret = array();
$tab_ret = myfunction($param);
$data1 = $tab_ret[0];
$data2 = $tab_ret[1];
$tab_ret[0] = "Marcus";
$tab_ret[1] = "John";
$tab_ret[2] = "Peter";
$tab_ret[3] = "Paul";
$tab_ret[4] = "Ringo";
$str = implode("-",$tab_ret);
// Result string is John-Marcus-Peter-Paul-Ringo
If rather than using $tab_ret as return from the function you use
another array, that's OK.
--
Edit bug report at https://bugs.php.net/bug.php?id=80522&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80522&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80522&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80522&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80522&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80522&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80522&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80522&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80522&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80522&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80522&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80522&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80522&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80522&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80522&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80522&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80522&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80522&r=mysqlcfg