For Hanshunping 149 There is a question asking

Source: Internet
Author: User
Class A {public Function __construct () {echo "A construct";}      }  Class B extends A {  } $b =new B ();? >


Why the result is a construct


Reply to discussion (solution)

If your handout is not a mistake, then you can only say "mentor" is nonsense!

Ask Ah .... Come

If your handout is not a mistake, then you can only say "mentor" is nonsense!

You mean the teacher is pulling the crap.

Regardless of the facts, isn't it nonsense?

Regardless of the facts, isn't it nonsense?

Well, he can still see this 149.

I don't know, I haven't seen it.

I don't know, I haven't seen it.

Does the moderator think he's right to say that?

Except ①②, ③ is wrong, others are inaccurate.

Maybe it's a php version problem, I don't even know.

Extends a is not equal to new a?

See clearly. It's about the construction method. ④ people say can ⑤ wrong?

3 is wrong, and the result speaks louder than words.

Run the code test to know that 3 is wrong, but it is possible that PHP4 is the case.
Floor of the speaker I did not see, do not know when the tutorial, if it is PHP4, it is recommended not to see.

The constructor of the parent class is executed unless the subclass has its own constructor method.

 
  

Run the code test to know that 3 is wrong, but it is possible that PHP4 is the case.
Floor of the speaker I did not see, do not know when the tutorial, if it is PHP4, it is recommended not to see.

The constructor of the parent class is executed unless the subclass has its own constructor method.

 
  

There is nothing worth seeing in the tutorial ... Like MySQL, I've been watching lately, but I can't find a good video.
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.