Hi Lanre,
I like your idea and I was even thinking about proposing the same addition.

The thing that is missing in the description is how the static class should
handle magic methods. Should they be disabled for them?

One plus of static classes which exist in other languages are that we
wouldn't need the hack with private constructor to build Singleton. But...
that's not the recommended pattern to use as explained by Larry. So I am
not really sure whether it makes sense to add complexity to the PHP source
code for such small benefit. Or maybe you see other benefits?

I must also admit like others that your further arguments as below, are not
good as someone after your implementation will need to maintain this code.
> 1. I will personally implement this feature.
> 2. This change is non-breaking and backward compatible.
> 3. It is entirely opt-in. If you hold reservations about using static
classes, you can simply choose not to use them.

Kind regards,
Jorg

Reply via email to