I hear this here, and elsewhere I hear that PHP has evolved into a decent language. Both can't be true.
I hear this here, and elsewhere I hear that PHP has evolved into a decent language. Both can't be true.
Namespaces allow non-global functions without a wrapping class already, IIRC. Looking up though, there seem to be special cases (legacy behavior, making everything at the top level global) when using namespaced files with include() statemtents, if I read the docs correctly.
Dumping pure functions as static members into wrapper classes was not uncommon when I used PHP.
But primarily, a lot of code was heavy on dependency injection and inversion of control, Symfony being the leader of this coding style maybe.
TFA also seems to be about class-oriented programming, but not the heavy design-pattern style mentioned above.
The linked TUI CLI parser looks like a nice and lean PHP OOP example.
$closure = function(){};
instead of
function closure(){}