I think you need to study the basic theory behind classes
I have various classes I want available everywhere in my scripts
. Your code is using a class object not a class. [PHP]class anotherClass {
function aMethod() {
global $aClass;
return $aClass->anotherMethod();
}
}[/PHP] To make a class available simply create another class object.
want to achieve the same result without the global keyword, maybe that's just wishful thinking..?
I cannot work out the result you are trying to achieve.
But if you want a class object available in another class then pass it's address as a parameter [PHP]class anotherClass {
function aMethod(&$aClass) {}[/PHP] If you want a class to use another class method or member then they need to be declared as static.
If you want a class to do everything another class can then consider inheritance.
At least you recognise even if by accident, that globals are bad practice.