If i have a code like this:
Is there any way to reuse the same object, or some more efficient method rather than creating the object each time? I have quite of few of these and it seems silly to have to do it this way.
Keith Davis
MCSA, A+, N+, Guru+, Geek+, Child of God++++++
Love and Service
Code:
class MyClass{
var $sProperty;
function MyMethod(){
echo $this->$sProperty}
}
}
function A(){
$oTest = new MyClass();
$oTest->sProperty = 'Hello World";
$oTest->MyMethod();
}
function A(){
$oTest = new MyClass();
$oTest->sProperty = 'Goodbye World";
$oTest->MyMethod();
}
Is there any way to reuse the same object, or some more efficient method rather than creating the object each time? I have quite of few of these and it seems silly to have to do it this way.
Keith Davis
MCSA, A+, N+, Guru+, Geek+, Child of God++++++
Love and Service