PHP警告魔术方法 set() class.XMLHttpRequest.php

发布于 2024-09-25 17:57:29 字数 381 浏览 2 评论 0原文

我有一个可以完美运行的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

围归者 2024-10-02 17:57:29

贴出相应的代码。

您可以通过删除第 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 replace private with public 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.

你如我软肋 2024-10-02 17:57:29

第 63 行:私有函数 __set($property, $value),第 89 行:私有函数 __get($property)

错误的根源可能在于调用这些函数的代码中。网站有多少部分调用 __set__get? (为此执行文件递归搜索)

我想说,在没有先了解总体影响的情况下突然将私有更改为公共可能是有风险的。 MVC 可能很难理解。

line 63 : private function __set($property, $value), line 89 : private function __get($property)

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文