DEV Community

Discussion on: An Algorithm to Swap Two Variables Synchronously, Without Creating a Temporary Variable

Collapse
 
goodevilgenius profile image
Dan Jones

PHP, too.

[$a, $b] = [$b, $a];
Enter fullscreen mode Exit fullscreen mode