replyhttps://blog.csdn.net/weixin_34152820/article/details/91883654?ops_request_misc=%7B%22request%5Fid%22%3A%22165787695116782184680934%22%2C%22scm%22%3A%2220140713.13 0102334..%22%7D&request_id =165787695116782184680934&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduend~default-1-91883654-null-null.142^v32^pc_search_v2,185^v2^control&utm_term=php access control&spm= 1018.2226. 3001.4187
This is this article, he created an uninitialized instance
replyYes, there was something wrong with the parentheses when I was a new student. It was like this at first, but I found it after I posted this question.
Public function __construct($name="") can be solved in this way. I just want to know if $s = new Student(); is wrong in not initializing this example.
That’s it
The constructor has formal parameters, and when creating a new object, it takes actual parameters