Classes and Initializing Variables
Posted: Tue Nov 22, 2011 5:25 am
Is it generally good practice to do:
instead of:
or is it redundant?
Code: Select all
class MyClass{
public $testvar;
public function __construct(){
$this->testvar = 1;
}
}Code: Select all
class MyClass{
public function __construct(){
$this->testvar = 1;
}
}