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

Merge

To merge is the action of combining two things into one. There are usually two meaning associated with PHP code:

  • Merging arrays, with the eponymous function array_merge(), or the + operator
  • Code merge, using a VCS, such as git, svn, etc.
<?php

    $array1 = [1,2];
    $array2 = [3,4];
    
    array_merge($array1, $array2); // [1,2,3,4]
    $array1 + $array2;             // [1,2,3,4]

?>

Documentation

See Also