4 ms·
It's a few lines of code, I would not call that complex. And the usage is. GlobslSingleton::set('Something Meaningful',$unique_var); and GlobslSingleton::get
by DjDarkman 16y ago
It's a few lines of code, I would not call that complex. And the usage is.
GlobslSingleton::set('Something Meaningful',$unique_var);
and
GlobslSingleton::get('Something Meaningful');
I don't think this is complex at all.
This doesn't force you to use $unique_var as a variable name(I know it can be worked around). One of the biggest problem with globals is that they can crash and burn if someone else's code purges it by accident.
Also my pattern allows 'load on demand', I can incorporate it in if I'd want to, your does not.