Re: No answers found - Why var and why & ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



var $varname before a constructor is just conventional syntax when defining
a class.

class myClass {
var $myThis;

function myClass() {
}
}

I'm sure you can do this another way, but it just makes reading the class
very easy, and it defines those variables for the entire scope of the class.

-dd


"André Cupini" <andre@neobiz.com.br> wrote in message
20030909152154.97733.qmail@pb1.pair.com">news:20030909152154.97733.qmail@pb1.pair.com...
> Save all programers! (sorry my "brazilian english")
>
> I have a simple doubt, but i´m tired because i not found answers...
> Why, inside a class, declarare $this variables in a format "var
$varname;"
> before of a constructor?
> And, please, what intend the "&" signal before functions name?
>
> I know the arguments reference methods like this:
> function bla(&$reference_arg)
>
> But what's the diference of the sintax:
> function &bla(&$var)
>
> Thanks for attention
>
> --
> André Cupini
> Programador - NeoBiz
> andre@neobiz.com.br
> http://www.neobiz.com.br

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux