Static Method
Static methods are methods defined with the static keyword. They have to be called with the name of the class, rather than an instantiated object.
<?php
class X {
static function foo() {
echo __METHOD__;
}
}
//displays x::foo
x::foo();
?>
See Also
- When to use static methods
- When Should You (And Shouldn’t You) Use Static Methods in Laravel/PHP? A Practical Guide
- Static Methods in PHP: Practical Patterns, Pitfalls, and Production Guidance (2026)