would the compare function be better used as a method inside the class itself?
do the numbers need to be set as class properties?
$app->compare($number1,$number2);
Could set your numbers as properties AND give you the desired compare output.
public function compare($n1,$n2){
$this->number1 = $n1; //youd need to validate these nos.
$this->number2 = $n2; //these 2 lines perhaps not needed
if($n1 > $n2){
return true;
}else{
return false;
}
}
just a thought
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
What is the reason you choose if: else: endif; over curly brackets ?
pritaeas
Posting Expert
5,483 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
I try to stick to these standards where possible:
http://pear.php.net/manual/en/standards.php
However, I do stray sometimes when writing PURELY personal projects. Problem is, if I ever need to release the code to somebody else, for whatever reason, I find that I have to go and 'de-personalise' it. What a waste of time, if only I'd stayed on the standard track! :(
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080