PHP Version
4+
/* Merging Indexed Arrays */
$array1 = [1, 2, 3];
$array2 = [4, 5, 6];

// Merge the two arrays
$result = array_merge($array1, $array2);

print_r($result);
/*
Output:
    Array
    (
        [0] => 1
        [1] => 2
        [2] => 3
        [3] => 4
        [4] => 5
        [5] => 6
    )
*/

/* Merging Associative Arrays */
$assoc_array1 = ['a' => 'red', 'b' => 'green'];
$assoc_array2 = ['c' => 'blue', 'd' => 'yellow'];

// Merge the two associative arrays
$assoc_result = array_merge($assoc_array1, $assoc_array2);

print_r($assoc_result);
/*
Output:
    Array
    (
        [a] => red
        [b] => green
        [c] => blue
        [d] => yellow
    )
*/
array_merge(array array1, array2, array3, ...): array
$result = array_merge();
var_dump($result); // Output: Warning: array_merge() expects at least 1 parameter...

$result = array_merge(null);
var_dump($result); // Output: Warning: array_merge() expects at least 1 parameter...
$result = array_merge();
var_dump($result); // Output: array(0) { }

$result = array_merge(null);
var_dump($result); // Output: Fatal error: Uncaught TypeError:
$array1 = ['a' => 'apple', 'b' => 'banana'];
$array2 = ['b' => 'blueberry', 'c' => 'cherry'];

$result = array_merge($array1, $array2);

print_r($result);
/*
Output:
    Array
    (
        [a] => apple
        [b] => blueberry
        [c] => cherry
    )
*/
$array1 = [0 => 'apple', 1 => 'banana'];
$array2 = [1 => 'blueberry', 2 => 'cherry'];

$result = array_merge($array1, $array2);

print_r($result);
/*
Output:
    Array
    (
        [0] => apple
        [1] => banana
        [2] => blueberry
        [3] => cherry
    )
*/
$array1 = ['apple', 'banana', 'color' => 'red'];
$array2 = ['green', 'orange', 'color' => 'orange', 'shape' => 'circle'];

$result = array_merge($array1, $array2);
print_r($result);
/*
Output:
    Array
    (
        [0] => apple
        [1] => banana
        [color] => orange
        [2] => green
        [3] => orange
        [shape] => circle
    )
*/
// First array
$array1 = [
    'name' => 'John Doe',
    'age' => 30,
    'address' => [
        'street' => '123 Main Street',
        'city' => 'Anytown',
        'state' => 'CA'
    ]
];

// Second array
$array2 = [
    'phone' => '123-456-7890',
    'email' => 'johndoe@example.com'
];

// Merge the two arrays
$result = array_merge($array1, $array2);

// Output the result
print_r($result);
/*
Output:
    Array
    (
		[name] => John Doe
	    [age] => 30
	    [address] => Array
	        (
	            [street] => 123 Main Street
	            [city] => Anytown
	            [state] => CA
	        )
	    [phone] => 123-456-7890
	    [email] => johndoe@example.com
    )
*/