Menu
Hello forums !!
I would like to know a few things about OOP.
Which one is better ?
1>
[code=php]class A{
var $a;
var $b;
function A(){
$this->a = array();
$this->b = 10;
}
}
2>
[code=php]class A{
var $a = array();
var $b = 10;
function A(){
}
}
In both cases there is initialization of default values in properties.
I would like to know which one is better to initialize the default values and why ?
Thanks in advance for the Suggestion.