|
Posted by Erwin Moller on 05/29/07 07:54
vinnie wrote:
> hi guys, i'm just at the beginning. I apologize. the file still gives
> me back an error:
>
> <<Parse error: syntax error, unexpected T_VARIABLE, expecting
> T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in d:\tryphp.php on line
> 19>>
>
> why? Can someone fix it so i can "study" the working one?
>
> class somma
> {
> var $uno=10;
> var $due=15;
> var $tre=15;
> function sum($uno,
> $due, $tre)
> {
>
> $totale = $uno + $due + $tre;
>
> return($totale);
> }
> function sum_2()
> {
> $totale = $this->sum($this->uno, $this-
>>due, $this->tre);
> return $totale;
> print("$totale");
Hi Vinnie,
Why do you first return something, and then print something on the next
line?
What do you think will happen?
Will the print-statement ever be reached?
Regards,
Erwin Moller
> }
> $somma=new_somma();
> $sum=$somma->(34,40);
> print("$sum");
> }
Navigation:
[Reply to this message]
|