How can the use of static calls in PHP affect performance?

Using static calls in PHP can affect performance negatively because they bypass the benefits of object-oriented programming, such as inheritance and polymorphism. To improve performance, consider using dependency injection to pass objects as parameters rather than relying on static calls. This allows for better flexibility, testability, and performance optimization.

class Example {
    public function doSomething($dependency) {
        // Use the dependency object here
    }
}

// Instantiate the Example class and pass in the dependency object
$example = new Example();
$dependency = new Dependency();
$example->doSomething($dependency);