My question is very objective. I need to swap values of two variables without using a third one in php. Using vector / array is not an option.
Searching found a solution in linguagem c
here , but I could not get through php
.
I've also found this solution , however a peculiar bug is happening.
This is my code:
$change_provider = "Desenvolvimento Web";
$change_receiver = "SEO(Search Engine Optimization)";
$change_provider ^= $change_receiver ^= $change_provider ^= $change_receiver;
print_r($change_provider); //string(19) "SEO(Search Engine O"
print_r($change_receiver); //string(19) "Desenvolvimento Web"
Notice that my output is missing some characters at the end. How to solve this problem? Thanks for helping.