What are the advantages and disadvantages of using a Config class versus a Config array for managing settings in PHP?

Using a Config class for managing settings in PHP provides better organization, encapsulation, and easier access to settings through methods. On the other hand, using a Config array is simpler and more straightforward, but it may lack the flexibility and functionality that a class can offer.

// Using a Config class for managing settings
class Config {
    private $settings = [];

    public function __construct(array $settings) {
        $this->settings = $settings;
    }

    public function getSetting($key) {
        return $this->settings[$key] ?? null;
    }

    public function setSetting($key, $value) {
        $this->settings[$key] = $value;
    }
}

// Example usage:
$config = new Config(['site_name' => 'My Website', 'debug_mode' => true]);
echo $config->getSetting('site_name');
$config->setSetting('debug_mode', false);
```

```php
// Using a Config array for managing settings
$config = [
    'site_name' => 'My Website',
    'debug_mode' => true
];

// Example usage:
echo $config['site_name'];
$config['debug_mode'] = false;