PHP警告魔术方法 set() class.XMLHttpRequest.php
我有一个可以完美运行的 php 脚本 但我收到两个错误:
Warning: The magic method __set() must have public visibility
and cannot be static in C:\wamp\www\class.XMLHttpRequest.php on line 63
Warning: The magic method __get() must have public visibility
and cannot be static in C:\wamp\www\class.XMLHttpRequest.php on line 89
这重要吗?我可以让它消失吗?或修复?
提前致谢!
i have a php script that runs perfectly
but i get 2 errors:
Warning: The magic method __set() must have public visibility
and cannot be static in C:\wamp\www\class.XMLHttpRequest.php on line 63
Warning: The magic method __get() must have public visibility
and cannot be static in C:\wamp\www\class.XMLHttpRequest.php on line 89
is this important? can i make it dissapear? or fix ?
thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
贴出相应的代码。
您可以通过删除第 63 行和第 89 行中的关键字
static
并将private
替换为public
来解决该问题。但是,即使 private static < code>__set() 或__get()
方法是无效的 PHP 并且没有多大意义,也许编写代码的人有这样做的理由。查看附近的评论以获取提示。Post the corresponding code.
You can fix the issue by removing the keyword
static
and replaceprivate
withpublic
on the lines 63 and 89. But even if a private static__set()
or__get()
method is invalid PHP and doesn't make much sense, maybe the guy who wrote the code had a reason to do so. Check nearby comments for hints.错误的根源可能在于调用这些函数的代码中。网站有多少部分调用
__set
和__get
? (为此执行文件递归搜索)我想说,在没有先了解总体影响的情况下突然将私有更改为公共可能是有风险的。 MVC 可能很难理解。
The source of the error may lie in the code that are calling these functions. How many parts of the website call
__set
and__get
? (perform a file recursive search for this)I would say it might be risky to suddenly change a private to public without seeing overall what that affects first. MVCs can be tricky to figure out.