I have one main.php file with a class definition. Other php files use this main.php file
//main.php
I cannot really see how the original question relates to the accepted answer. If I want to make sure that certain code is not executed more than once by third-party scripts that include it, I just create a flag:
The Singleton patterns just forces that all variables that instanciate one class actually point to the same only instance.