Why does a new private function with the same name as the parent class in the private method in oop-php report a warning?

Source: Internet
Author: User
First, declare that this is a STRICT error. If you do not open it in error_reporting, it is generally invisible. below is my code {code ...} it will report {code ...} if it is a public function overload, you can still say the past, and I just used a method with the same name in the private function... first, declare that this is STRICTError. If you are not there error_reportingOpen it, usually not visible, the following is my code

 

It will report an error

Strict Standards: Declaration of B::test() should be compatible with that of A::test() in /home/work/test.php on line 17

If yespublicFunction overloading can still be said in the past, but I only use methods with the same name in private functions, but this is not an overload for subclass. Why is this still a warning?

Reply content:

First, declare that this isSTRICTError. If you are not thereerror_reportingOpen it, usually not visible, the following is my code

  

It will report an error

Strict Standards: Declaration of B::test() should be compatible with that of A::test() in /home/work/test.php on line 17

If yespublicFunction overloading can still be said in the past, but I only use methods with the same name in private functions, but this is not an overload for subclass. Why is this still a warning?

Post link: http://stackoverflow.com/questions/31...

In this case, STRICT mode requires:
1. The access level is the same
2. The parameters are the same
3. The default parameter values are the same.

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.