I got a problem
class a
{
public $aa=1;
public function dd(){
$this->aa = 2;
}
public function gg(){
echo $this->aa ;
}
}
how come in the go method echo $this->aa still be ‘1’?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Because
dois reserved keyword in PHP.Demo of
doas method name. (An error)Demo without
do, successfull outputs 2You should change method name from
doto something else since it is reserved keyword used indo-whileloop.