What are common mistakes when using arrays in PHP?

Common mistakes when using arrays in PHP include not properly initializing arrays before use, not using the correct syntax to access array elements, and not checking if an array key exists before accessing it. To avoid these mistakes, always initialize arrays before use, use square brackets to access array elements, and use functions like `isset()` or `array_key_exists()` to check if a key exists before accessing it.

// Incorrect way to access array elements
$array = [1, 2, 3];
echo $array(0); // Incorrect syntax, should use square brackets

// Correct way to access array elements
$array = [1, 2, 3];
echo $array[0]; // Correct syntax using square brackets

// Incorrect way to check if key exists
$array = ['key' => 'value'];
if ($array['nonexistent_key']) {
    echo 'Key exists';
}

// Correct way to check if key exists
$array = ['key' => 'value'];
if (isset($array['nonexistent_key'])) {
    echo 'Key exists';
}