What are the potential pitfalls of instantiating classes with static methods in PHP?

When instantiating classes with static methods in PHP, potential pitfalls include tight coupling, difficulty with unit testing, and reduced flexibility for future changes. To solve this issue, consider using dependency injection to pass instances of the class into the static method instead of directly instantiating it.

class MyClass {
    public static function myMethod(MyDependency $dependency) {
        // Use $dependency object here
    }
}

class MyDependency {
    // Dependency class implementation
}

$dependency = new MyDependency();
MyClass::myMethod($dependency);