Welcome Guest, Not a member yet? Register   Sign In
Temp data that must be destroyed at end of lifecycle
#6

(06-26-2020, 09:15 AM)vincent78 Wrote: @Dave friend: Thanks for your answer

I have an abstract class User
Maybe, the best solution is to have a public static property in this class : $current_user
and then, I can access like this:
User::$current_user

Yes, that would work. Any data that is held only in (non-persistent) memory like a class instance object will automatically be destroyed when script execution ends. I assumed from the original question that you were using something that was potentially persistent like session data or a temp database table.
Reply


Messages In This Thread
RE: Temp data that must be destroyed at end of lifecycle - by dave friend - 06-26-2020, 11:08 AM



Theme © iAndrew 2016 - Forum software by © MyBB