3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = 11; $bar = 12; //optimal: memory used once $foo = $foo ^ $bar; $bar = $foo ^ $bar; $foo = $foo ^ $bar; var_dump($foo, $bar); echo memory_get_peak_usage(); $foo = 11; $bar = 12; //readable: $baz = $foo; $foo = $bar; $bar = $baz; // var_dump($foo, $bar); echo memory_get_peak_usage();

preferences:
25.21 ms | 402 KiB | 5 Q