Created
June 20, 2014 01:21
-
-
Save jeremejazz/f0261bd6e79dc8f82983 to your computer and use it in GitHub Desktop.
Swap two integers without 3rd integer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| a = 10; | |
| b = 20; | |
| a = a + b; // a = 30 | |
| b = a - b; // b = 10 | |
| a = a - b; // a = 20 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment