In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to use private in php. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
In PHP, private is an access modifier that restricts the accessibility of decorated members, meaning "private", that is, it can only be accessed and used within the class, and the syntax is "class class name {private property or method definition}".
This article operating environment: Windows10 system, PHP7.1 version, Dell G3 computer.
What is the use of private in php
Public represents the global, and all the internal and external subclasses of the class can access it.
Private means private, and can only be used within this class
Protected means protected and can only be accessed in this class or subclass or parent class
Access control modifier
Form:
Class class name {access control modifier property or method definition;}
Their role is to "limit" the accessibility of the members they modify.
Accessibility:
Is to use the "validity" (legitimacy) of these two forms of syntax in your code:
Object-> instance property or method
Class:: static property or method
Access control modifiers, which need to be combined with the location where the grammatical form is used to determine whether they are accessible.
This is the end of the article on "how to use private in php". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.