sos99

How to call a class only once (global variable scope)

Posted 3 weeks ago by sos99

on clean project in php (without framework), i have class that i need available in all classes (for example log, db) , what is the best OOP way to do it available without global variable or call to new object all the time ?

https://stackoverflow.com/questions/28730071/have-only-one-instance-of-a-class

https://stackoverflow.com/questions/3695663/functions-that-can-be-called-only-once

https://wordpress.stackexchange.com/questions/45648/how-to-call-a-function-only-once-global-variable-scope

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.