The object property can absolutely have the same name as the variable in your script, it has no relationship whatsoever. Even if you utilized it within a class method the scope keeps them apart.
Generally speaking you don't want code like this:
Code: Select all
$O= &new Object();
$O->property = 'my name';
This breaks encapsulation and encourages properties to be modified at any given point outside the class. Obviously if you're still working with PHP4 you don't have a choice other than to use setters and getters and encourage everyone working with the class to use them.
At this point, are we still wrestling with the 'undefined variable' error? If you've made
modsadmins an object property, are you setting it and accessing it within the class as
$this->modsadmins? Can you show us the bit of code where you're using the variable inside the class?