5 ms·
The one thing I don't like about PHP is that the whole application is bootstraped (and autoloading and the configuration is re-evaluated) in every single http r
by dakiol 1y ago
The one thing I don't like about PHP is that the whole application is bootstraped (and autoloading and the configuration is re-evaluated) in every single http request. Sure thing there's cache and all, but it just doesn't feel right (compared, to, for instance, an http server written in golang)
- klaussilveira 1y agoThere are well documented and production-ready libraries that you can use to run your own servers with PHP alone, no need for fpm or mod_php. PHP's JIT is pretty impressive and you would be blown away by the results. https://reactphp.org/ https://reactphp.org/ https://www.php.net/manual/en/book.ev.php https://www.php.net/manual/en/book.ev.php https://bitbucket.org/osmanov/pecl-event https://bitbucket.org/osmanov/pecl-event https://www.workerman.net/ https://www.workerman.net/
- duskwuff 1y agoIt doesn't have to be. Some PHP runtimes allow an application to run in a mode where a single script execution processes multiple HTTP requests: https://frankenphp.dev/docs/worker/ https://frankenphp.dev/docs/worker/
- mhsdef 1y agoThis is one of the things I do like about PHP. Intrinsically minimized state (to a certain degree).
- PetahNZ 1y agoThis is one of the best things about PHP IMO. It makes it very easy to scale out.
- bornfreddy 1y agoYup. No shared state by default.
- const_cast 1y agoIt also makes it much easier to debug and forces the complexity down.
- creatonez 1y agoYou're right. It's a completely asinine approach. Especially when PHP itself is used as a templating language. And solutions that try to fix this (custom templating engines, runtimes that run the whole thing inside a continuous PHP process) are simply putting lipstick on a pig. The solution is to use a language that wasn't originally called "Personal HomePage"