9
Why use VAR in php if we can already declare variables without VAR?
We can do this: $teste
then why do it? var $teste
For example, it’s the same thing I do?
class Caneta {
var $modelo;
var $cor;
}
And that:
class Caneta {
$modelo;
$cor;
}
Look at my issue, rray, please? :)
– Lucas de Carvalho
@Lucascarvalho complemented the answer.
– rray
Thank you rray, just summing up, is it the same thing to use any of the 2? In the case on PHP5
– Lucas de Carvalho
@Lucascarvalho is the same thing, the ideal is not to use
var
same. In the manual it mentions that from version 5.0 to 5.1.2 was generated a Warning after no more. manual– rray
rray, you know why in Netbeans IDE it’s a mistake if I don’t use var?
– Lucas de Carvalho
Look? http://prntscr.com/fhu95j
– Lucas de Carvalho
@Lucascarvalho is warning that you should use some access modify. It suggests that it is more readable to use some but in this case no error is generated, if I am not mistaken you can turn off some rules of netbeans code checking.
– rray