Bug #68969 [NEW]: Implode
| From: | pl dot lamballais at flashover dot fr | Date: | Sun, 01 Feb 2015 21:29:14 +0000 |
| Subject: | Bug #68969 [NEW]: Implode | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-190386@lists.php.net to get a copy of this message | ||
From: pl dot lamballais at flashover dot fr
Operating system: Debian
PHP version: 5.5.21
Package: *General Issues
Bug Type: Bug
Bug description:Implode
Description:
------------
---
From manual page: http://www.php.net/function.implode
---
Get an array that I fill with values, and then want to implode it. I
notice that if I fill the array in logical order (index
1,2,3,4,5,6,7,8,9), implode is OK. But if I fill it in an other order
(eg index 1,4,7,2,5,8,3,6,9), implode don't respect the index.
Test script:
---------------
<?php
for ($x=0; $x < 50; $x=$x+3)
{
$tab[$x] = "A";
}
for ($x=1; $x < 50; $x=$x+3)
{
$tab[$x] = "B";
}
for ($x=2; $x < 20; $x=$x+3)
{
$tab[$x] = "C";
}
for ($x=0; $x < 50; $x++)
{
// Here is correct result we expect
echo $tab[$x];
}
$str = implode('',$tab);
echo "<br>".$str."<br>\n";
?>
--
Edit bug report at https://bugs.php.net/bug.php?id=68969&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68969&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68969&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68969&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=68969&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=68969&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=68969&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=68969&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=68969&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=68969&r=support
Expected behavior: https://bugs.php.net/fix.php?id=68969&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=68969&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=68969&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=68969&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68969&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=68969&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=68969&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=68969&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=68969&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=68969&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=68969&r=mysqlcfg