Hacker News new | ask | show | jobs
by tyingq 2762 days ago
"Better caching of compiled code by allowing sharing of compiled or live objects (classes, objects, etc) between running PHP scripts"

I'm a little confused on this piece, as PHP does have a cross process opcache. People also use things like apcu to share userspace things across processes (uses mmap).

1 comments

I think the idea is for example creating an object in 1 PHP process, and modify it in the second.

The point is there is no shared state in the running problem

Well, it mentions classes, for example. The opcache handles that already, cross process. For a live object, people tend to use apcu. It's not as nice as a shared object across 2 couroutines, but it's reasonably fast because it's using mmap and fairly fast serialization to share the object.

So, what they are proposing is helpful. But, they seem to be assuming that PHP shares nothing across processes. That's just not true.

I'm not sure what you're trying to argue. A shared server state is a drastically different model from having the ability to access a key->value store. Try sharing a socket for example.
That would have been a better example than 'classes', yes.