Hey guys, I'm making a new site and want to get out of the practice of bad coding habits. In the past, whenever I wanted to reference a function, I would make an object of that class. For example,
Class clsSomeClass
function DoSomething()
{
$objclsSomeClass = new clsSomeClass();
$objclsSomeClass->SomeOtherFunction();
}
function SomeOtherFunction
{
//DO SOMETHING
}
I've noticed some people would use "$this" and not define a class instance since it's already within that class. Is this the most efficient way to do this. Is my way just wasting system memory? Thanks, any input would be greatly appreciated.