有人可以向我解释一下php类是否等同于
Class name
{
Public: <----- this bit
string variable;
int another;
bool athird;
}
或者你必须在php中声明公共变量
Class name
{
public $variable;
public $another;
public $athird;
}
感谢您的帮助
答案 0 :(得分:0)
您可以一次声明多个变量,用逗号分隔:
class name{
public
$cat = 'cat',
$dog = 'dog',
$hamster;
private
$login_message = 'blah',
$other = 33;
}