←back to thread

123 points jonfelsar | 2 comments | | HN request time: 0s | source
Show context
dingdingdang ◴[] No.45189044[source]
The point made in the article:

* resource leaks are non-existent

Can not be emphasized enough imo. The amount of absolute ridiculous levels of pain instigated by expecting a core code loop to run -forever- and doing so well while being written for some web project or other is just too much to fathom. Just use PHP and serve the request. Then let it die. Then serve a new request.

replies(7): >>45189095 #>>45189147 #>>45189280 #>>45189375 #>>45189453 #>>45189777 #>>45194297 #
1. majorbugger ◴[] No.45189453[source]
This has got to be a joke.

What if you need any kind of in-memory cache? Or in general, any kind of application maintaining state, for, say, performance reasons?

replies(1): >>45189689 #
2. EGreg ◴[] No.45189689[source]
PHP has apcu as the in-memory cache

And it’s not a joke, PHP is actually the most secure runtime environment out there for web hosting, PRECISELY because of the shared-nothing architecture.

Faster runtimes exist, like Swoole and recently FrankenPHP, to do evented programming like Node JS. But let me tell ya — you risk all kinds of leaks, both of unfreed memory and of secrets, across requests. It ain’t worth it most of the time!