class test {
public $isNew;
public function isNew(){}
}
$ins = new test();
$ins->isNew
Here,how does php parse $ins->isNew?
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.
PHP is not a functional programming language where functions are also data. So
$ins->isNewwouldn’t be ambiguous to either refer to the methodisNewor the attributeisNew.$ins->isNewis always an attribute and$ins->isNew()a method call.