I recently ran across a problem: object properties are recreated every time a new object is created. The flow:
- a new instance of Bootstrap class is created under index.php
- a new instance of the X class is created under Bootstrap
The point is to keep all the properties of class X by not creating a new instance of X if it has been already created once. What would be the best way to achieve this? Or maybe it is the flow itself that should be changed?
Thanks