What are the advantages and disadvantages of using static methods in PHP for functions that require state management?

When using static methods in PHP for functions that require state management, the advantage is that you can easily access and modify the state without the need for creating an instance of the class. However, the disadvantage is that it can lead to tightly coupled code and make testing more difficult.

class StateManager {
    private static $state;

    public static function setState($value) {
        self::$state = $value;
    }

    public static function getState() {
        return self::$state;
    }
}

// Set state
StateManager::setState('example');

// Get state
echo StateManager::getState(); // Output: example