Home >Backend Development >PHP Tutorial > 请问PHP报错的原因

请问PHP报错的原因

WBOY
WBOYOriginal
2016-06-13 12:54:53871browse

请教PHP报错的原因?
报错如下,请问是怎么意思?

Warning: The magic method __get() must have public visibility and cannot be static in D:\xampp\htdocs\class\Page.php on line 41<br />
<br />
Notice: A session had already been started - ignoring session_start() in D:\xampp\htdocs\index.php on line 13<br />
<br />
Notice: Use of undefined constant g_S_name - assumed 'g_S_name' in D:\xampp\htdocs\index.php on line 14<br />
<br />
Notice: Undefined index: g_S_name in D:\xampp\htdocs\index.php on line 14


php
------解决方案--------------------
1 __get只能public,不能用static关键字修饰
2 上述错误有warning输出,与session_start()之前不能输出数据冲突。
3 g_S_name当常量输出了。可能与未加$引起的。
4 未定义的g_S_name索引。

------解决方案--------------------
第一个错误是语法错误。
下面的三个错误,可以通过errro_reporting(E_ALL & ~E_NOTICE);来不显示。
------解决方案--------------------
做任何事情都要遵守规则
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn