How to store instances of the same object in PHP (stateless)? -
I was looking for "Pimple" for PHP, "Simple Service Container" by Fabian Potentier, and with the following comment Was surprised:
By default, every time you receive a service, Pimple gives a similar example if you have a different example to return for all calls If you want, wrap your anonymous function with the factory () method.
Based on PHP execution, how would it be possible? PHP does not allow me to execute PHP scripts every time a new instance of the object?
Edit: Pimple link -
Answer this, because in my comments There was no one. Answer - You can not! PHP is stateless on HTTP, and I have taken pamphlet documents from context.
If you need to get it, you should see it in the cache system (APC, Memcatch) or Object server (radis).
Thanks for the clarification.
Comments
Post a Comment