Home > Backend Development > PHP Tutorial > 魔术方法_set()和_get()是不是一定要声明为public?解决方案

魔术方法_set()和_get()是不是一定要声明为public?解决方案

WBOY
Release: 2016-06-13 13:31:57
Original
1004 people have browsed it

魔术方法__set()和__get()是不是一定要声明为public?
魔术方法__set()和__get()是不是一定要声明为public?我的声明为private时,在类外面调用,浏览器提示为“要将__set()和__get()设为public”,可是很多资料书上都可以声明为private啊?

------解决方案--------------------
是的,一定要声明为public,只用这要,才能在外部访问

很多资料书上都可以声明为private啊
请永远的删除这些资料,因为他是在骗你!
------解决方案--------------------

探讨

是的,一定要声明为public,只用这要,才能在外部访问

很多资料书上都可以声明为private啊
请永远的删除这些资料,因为他是在骗你!
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template