thephpleague / container

Small but powerful dependency injection container

Home Page:http://container.thephpleague.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[question] Shared Objects

hakuno opened this issue · comments

Hey!

I read the docs.

I've a question at here https://container.thephpleague.com/3.x/definitions/ concerning Shared Objects.

We can tell a definition to only resolve once and return the same instance every time it is resolved.

Do the Shared Objects preserve their internal data persisted in memory?

Is that like Singleton? Can I rely on that and update the data?

I need to update the data and keep using it.

Thanks!

An object is always by reference so yes it will persist data during a single request/process.