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 ?
t开发者_开发问答hanks in advance!
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.
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.
精彩评论