Req #48110 [Fbk->NoF]: Add Freeze Array for shuffle
| From: | php-bugs at lists dot php dot net | Date: | Tue, 30 Dec 2014 10:41:32 +0000 |
| Subject: | Req #48110 [Fbk->NoF]: Add Freeze Array for shuffle | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-189387@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=48110&edit=1
ID: 48110
Updated by: php-bugs@lists.php.net
Reported by: bholbrook at servillian dot com
Summary: Add Freeze Array for shuffle
-Status: Feedback
+Status: No Feedback
Type: Feature/Change Request
Package: Arrays related
Operating System: Irrelevant
PHP Version: Any
Private report: N
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2014-04-30 22:59:23] levim@php.net
Is this something you are still interested in seeing?
------------------------------------------------------------------------
[2009-04-29 16:14:08] bholbrook at servillian dot com
Description:
------------
Add an optional parameter to the shuffle to freeze certain elements in place.
Reproduce code:
---------------
//CURRENTLY
$arrShuffleMe = array(1,2,3,4,5);
shuffle($arrShuffleMe); // produces array(2,4,1,5,3);
//PROPOSED
$arrShuffleMe = array(1,2,3,4,5);
$arrFreezeKeys = array(0,4);
shuffle($arrShuffleMe, $arrFreezeKeys); // produces array(1,3,4,2,5);
$arrShuffleMe = array(1,2,3,4,5);
$arrFreezeKeys = array(0,1);
shuffle($arrShuffleMe, $arrFreezeKeys); // produces array(1,2,4,5,3);
Expected result:
----------------
The shuffle function only shuffles array values whose keys do not match the keys passed in (by
array) in the second parameter.
Actual result:
--------------
Feature request. Currently no actual result.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=48110&edit=1