Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Swap

Swap have several meanings.

  • Memory, when it is stored on the disk.
  • The operation to exchange two things, one for another. For example, variable swap, which exchange their value.
<?php

    // simple swap technique : 
    // list and array are used for readability
    list($a, $b) = array($a, $b);
    
    // modern version
    [$a, $b] = [$a, $b];

?>

Documentation

See Also