If I create a class called SampleClass, and give it a method called GetRecord, is there a difference between:
$test = new SampleClass();
$var1 = $test->GetRecord(1);
$var2 = $test->GetRecord(2);
$var3 = $test->GetRecord(3);
$var4 = $test->GetRecord(4);
And:
$var1 = new SampleClass();
$var2 = new SampleClass();
$var3 = new SampleClass();
$var4 = new SampleClass();
$var1 = $var1->GetRecord(1);
$var1 = $var2->GetRecord(2);
$var1 = $var3->GetRecord(3);
$var1 = $var4->GetRecord(4);
I know the latter example is more lines of code, but is either example specifically right or wrong? Is there a reason to use one rather than the other?
Thanks in advance,
Chris.