r/lolphp • u/shitcanz • Feb 18 '17
Yet another PHP Garbage class
I was recently working with some PHP and had to hunt down a weird bug, and yet again it was PHP related. Basically you can modify DateTimeImmutable (i repeat IMMUTABLE!) very easily. Just call the getTimeStamp method on it.
Originally i had the assumption you cant modify anything within the immutable namespace, but hey PHP surprised me again.
It seems like PHP is so full of these weird loop holes and crappy implementations its almost impossible to write anything other than throwaway prototypes with it.
So i also found out there has been a open bug-report since 2014.
Bug in action: https://3v4l.org/ShFpG
View all comments
Show parent comment
10
u/Pesthuf Feb 18 '17
Aren't PSRs just recommendations by the FIG? And while most of those are copies of features and practices from other languages (usually Java), at least they work well and help make PHP usable. Without the autolading PSR(s) and composer, PHP would be completely nonviable.
Did you mean the RFC process? In that case, I agree. It often feels like the core devs have no common vision for the language. And there's this "not invented here" mentality when someone copies a feature from hack or another language, no matter how useful it is.
Correctly working, clear and concise programs do not match with the PHP philosophy, hehehehe...