I have a question for Han Shunping 149.
Class A {public function _ construct () {echo "A constructor" ;}} class B extends A {}$ B = new B () ;?>
Why is the result A constructed?
Reply to discussion (solution)
If it is not your handout transcript error, you can only say "mentor" is talking nonsense!
Ask .... People ,,,
If it is not your handout transcript error, you can only say "mentor" is talking nonsense!
You mean the teacher is messing around.
Regardless of the facts, isn't it a nonsense?
Regardless of the facts, isn't it a nonsense?
Well, he can't see it in his 149 lecture.
I don't know. I haven't seen it.
I don't know. I haven't seen it.
Does the moderator think this is correct?
Except ① ②, ③ is incorrect, and others are not accurate.
Maybe it's the php version. I don't know it.
Isn't extends A equal to A new?
See clearly. It is about the constructor. ④ Is it true?
3 is wrong, and the result is better than words
Run the code test and you will know that 3 is wrong, but it may be because php4 is like this.
I have not read what I have told you. I don't know when the tutorial will be. if it's a php4 tutorial, I suggest you stop reading it.
Unless the subclass has its own constructor, the constructor of the parent class is executed.
Run the code test and you will know that 3 is wrong, but it may be because php4 is like this.
I have not read what I have told you. I don't know when the tutorial will be. if it's a php4 tutorial, I suggest you stop reading it.
Unless the subclass has its own constructor, the constructor of the parent class is executed.
There are some worth reading tutorials... For example, in mysql, I recently watched but couldn't find any good videos.