Req #70736 [Fbk->NoF]: Support to swap() function
| From: | php-bugs at lists dot php dot net | Date: | Sun, 24 Jun 2018 04:22:32 +0000 |
| Subject: | Req #70736 [Fbk->NoF]: Support to swap() function | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-215902@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70736&edit=1
ID: 70736
Updated by: php-bugs@lists.php.net
Reported by: david dot proweb at gmail dot com
Summary: Support to swap() function
-Status: Feedback
+Status: No Feedback
Type: Feature/Change Request
Package: Scripting Engine problem
PHP Version: Next Major Version
Assigned To: cmb
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:
------------------------------------------------------------------------
[2018-06-16 13:46:43] cmb@php.net
> What's the problem with
list($a, $b) = [$b, $a]; ?
Good question!
------------------------------------------------------------------------
[2015-10-28 04:51:44] mail at jerrygrey dot me
Pull request: https://github.com/php/php-src/pull/1609
------------------------------------------------------------------------
[2015-10-28 04:51:25] marcio@php.net
What's the problem with list($a, $b) = [$b, $a]; ?
------------------------------------------------------------------------
[2015-10-19 04:12:06] david dot proweb at gmail dot com
Description:
------------
This function should swap two variables. Currently it can be done by code a swap function, like:
function swap(&$a, &$b) {
$tmp = $a;
$a = $b;
$b = $tmp;
}
I think that should be useful PHP do it alone, and simple to include it on code.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70736&edit=1