Is it advisable to make classes static in PHP?

It is not advisable to make classes static in PHP unless absolutely necessary. Static classes limit flexibility and can make code harder to test and maintain. It is better to use dependency injection or other design patterns to achieve the desired functionality without resorting to static classes.

class Example {
    private $dependency;

    public function __construct(Dependency $dependency) {
        $this->dependency = $dependency;
    }

    public function doSomething() {
        $this->dependency->doSomething();
    }
}

$dependency = new Dependency();
$example = new Example($dependency);
$example->doSomething();