Say for instance I have ...
$var1 = \"ABC\"
$var2 = 123
and under certain conditions I want to sw
There's no function I know of, but there is a one-liner courtesy of Pete Graham:
list($a,$b) = array($b,$a);
not sure whether I like this from a maintenance perspective, though, as it's not really intuitive to understand.
Also, as @Paul Dixon points out, it is not very efficient, and is costlier than using a temporary variable. Possibly of note in a very big loop.
However, a situation where this is necessary smells a bit wrong to me, anyway. If you want to discuss it: What do you need this for?