PHP Static Return Type
Description
Introduced in PHP 8.0, static return types1 guarantee that a method will return an instance of its object, and not that of a parent.
Syntax
class Foo
{
public function tralala(): static
{
return $this;
}
}