class inherits and overloads the function, how to invoke the function of the pre-overloaded parent class with the subclass object

Source: Internet
Author: User
After the class inherits and overloads the function, how to invoke the function of the pre-overloaded parent class with the child class object
Hello everyone:
I beginner PHP, see the Inheritance and overloading part, ask a question:
Suppose class A {function My_func (...);}
Class B extends A {function My_func (...)}
The above 2 classes A and B, b inherits A, B also overloads the My_func function in a
Now build the B object $obj _b = new B ();
Suppose I want to refer to the My_func function in a with a B object,
How do I write it?

------Solution--------------------
It seems that this is called rewriting, PHP does not seem to support method overloading
  • Related Article

    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.