Some of the reactions to my last blog post on https://verraes.net/2014/06/named-constructors-in-php/, originate from the notion that static methods are inherently bad and should never be used. Static methods are nothing more than namespaced global functions.

As for global functions: We use those all the time.

You might still feel resistance against something like Calculator::sum($x, $y), because it can not be extended or mocked.

There is, in PHP, an interesting distinction between + and Calculator::sum($x, $y): the former can not be injected, the latter can:
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners