Why does PHP report an error?

Source: Internet
Author: User
Why is the PHP error reported? The following error is reported. what does it mean? Warning: & nbsp; The & nbsp; magic & nbsp; method & nbsp ;__ get () & nbsp; must & nbsp; have & nbsp; public & nbsp; visibility & nbsp; and ask why PHP reports an error?
The following error is reported. what does it mean?
Warning: The magic method __get() must have public visibility and cannot be static in D:\xampp\htdocs\class\Page.php on line 41

Notice: A session had already been started - ignoring session_start() in D:\xampp\htdocs\index.php on line 13

Notice: Use of undefined constant g_S_name - assumed 'g_S_name' in D:\xampp\htdocs\index.php on line 14

Notice: Undefined index: g_S_name in D:\xampp\htdocs\index.php on line 14


Php
------ Solution --------------------
1 _ get can only be public and cannot be modified with the static keyword
2. the preceding error has a warning output and cannot conflict with the output data before session_start.
3 g_S_name: when the constant is output. It may be caused by not adding $.
4. undefined g_S_name index.

------ Solution --------------------
The first error is a syntax error.
The following three errors can be returned through errro_reporting (E_ALL &~ E_NOTICE); to not display.
------ Solution --------------------
Follow the rules to do everything.

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.