If you patched PHP yesterday, you're not done yet 🚨
php2shell started with an error every PHP dev has seen a thousand times:
"Allowed memory size of 134217728 bytes exhausted"
Here's what actually went wrong, and what the update didn't fix 👇
You added declare(strict_types=1) to your PHP code, so bad values throw a TypeError, ...right?
Not quite. So many of our PHP files start with that line, but it protects a lot less than most of us think 👇
PHP package authors: a single |> in your code can fatal every user on PHP 8.4!!
PHP 8.5 shipped the pipe operator and clone with almost a year ago, and one line in your composer.json still decides if you can use them 👇
Every other week, I break down how PHP actually works under the hood, like what really happens between a composer.json constraint and a parse error in production.
The newsletter is free, and you can get in on it at https://t.co/Ksx0EgHobb
Every PHP dev has seen this in their FPM log:
"server reached pm.max_children setting (5), consider raising it"
Most of us raise the number and move on, ...which is how you take a server down 🫠
Here's the math 👇
Your PHP app's second browser tab just hangs until the first request finishes 🤔
Every request with that same cookie is waiting in line for something.
And most of us blame a slow query or throw more FPM workers at it, which does absolutely nothing 👇
Stuff like this session lock is what I dig into: every other week, I figure out what PHP is really doing underneath.
Get the newsletter: https://t.co/adhycLpbIu
@artillain@R3DWyvern@pechynho_ Agreed, that's a ridiculous use-case and anyone doing that doesn't understand what sessions are for. But for simple things like auth persistence, I don't see any reason not to use it.