"Calling a non-static method with: means causes an e_strict level exception." "Really?

Source: Internet
Author: User
"Using:: Calling a non-static method will result in an e_strict level error." "Are you sure?"


Class mycls{

function func ()
{
echo "None static";
}

}

Mycls::func ();

?>

There are no static methods to run, no mistakes.

------Solution--------------------
Front plus error_reporting (2048); I saw a mistake.

If you do not see it, then Ini_set (' Display_errors ', true);
------Solution--------------------
This is a problem that PHP has left behind.
The reason you didn't see the error is because you didn't include e_strict in the wrong category.
Error_reporting (E_all | E_STRICT); We'll get to the front and we'll know.
------Solution--------------------
Strict Standards:non-static Method Mycls::func () should not being called statically in

Turn off error display is a method, there are other ways to achieve the purpose
For example, turn off the monitor when running.
------Solution--------------------
In fact, this mistake should not have been reported.

Whether or not static methods should be available:: Access
Otherwise prean::medhod in:: No, it appears ambiguity?
  • 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.