Re: Variable Swap
| From: | Yasuo Ohgaki | Date: | Thu, 13 Dec 2001 03:30:56 +0000 |
| Subject: | Re: Variable Swap | ||
| References: | 1 2 | Groups: | php.lang |
| Request: | Send a blank email to php-lang+get-257@lists.php.net to get a copy of this message | ||
Andrei Zmievski wrote:
On Mon, 10 Dec 2001, Bharath Bhushan Lohray wrote:This is nice code. I didn't think of that :) Question is which is faster & memory efficient, but there wouldn't be much difference though. -- Yasuo OhgakiIs there a way of swapping the values of two variables without involving a third variable. something similar to the SWAP(A$,B$) of BASIC I have a big variable(array) and I want to keep my script's memory requirements as low as possible.list($b, $a) = array($a, $b); -Andrei * Reality isn't all it's cracked up to be. *