We're setting the bar pretty low for what's a good thing in a language here.
We're setting the bar pretty low for what's a good thing in a language here.
PHP with fastcgi reliably and quickly resets the php process to freshly launched state after every request, and very few languages can manage that trick in a production context.
For example Gradle (a java build system) runs a daemon that hosts a bunch of tasks that run and die.
Docker does it with images.
The browser does it with tabs.
Php achieves it with the help of server components. That is fine, but I wouldn't advertise it as a feature.
This property is definitely one of the things I love about PHP -- when the request is done, everything is thrown away. This encourages you to do the minimum amount of work to get your HTML (or whatever) out the door. I'd like to say it forces you, but it doesn't really -- I've seen plenty of 'lightweight frameworks' that mess around for 50 ms creating cathedrals of objects that just get thrown away on a hello world page; if you do the minimum amount of work, you can get pages out the door pretty quick. Layering and abstraction can solve a lot of things, but it can't solve wrong abstractions.
What I find ironic is that creating the illusion of state in php is an absolute pain without a framework, which again applies to most language/server combos I've tried.
Guidelines, good/bad practices and patterns are merely suggestions, enforcement is king.