In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the relevant knowledge of "what magic methods php7 has". In the operation of actual cases, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Php7 magic methods include: 1, "_ constract" method, 2, "_ _ destruct" method, 3, "_ _ set" method, 4, "_ _ get" method, 5, "_ _ call" method, 6, "_ _ callStatic" method, 7, "_ _ toString" method and so on.
This article operating environment: Windows7 system, PHP7.4 version, Dell G3 computer.
What are the magic methods of php7?
The magic method is a special method that overrides the default operation of PHP when performing certain operations on an object.
PHP retains all method names that begin with _ _. Therefore, it is not recommended to use such method names unless you override the behavior of PHP.
Php7 magic methods are:
_ _ constract: triggers when a class is instantiated
_ _ destruct: triggered when an instance object is destroyed
_ _ set (string $name, mixed $value): triggered when an inaccessible member property is set
_ _ get (string $name): triggered when an inaccessible member property is obtained
_ _ call ($name,$arguments): triggered when a member method that is not accessible is accessed
_ _ callStatic ($name,$arguments): triggered when accessing a member static method that is not accessible
_ _ toString: triggered when an object instance is treated as a string
_ _ clone: triggered when a new object is created
_ _ invoke: triggered when an object is called as a function
_ _ sleep: triggered when data processing of an object does not need to save all data, such as when serialize () is serialized
_ _ wakeup: when unserialize (), the _ _ wakeup method is checked first.
_ _ unset (string $name): triggered when an inaccessible object property is unset
_ _ isset (string $name): triggered when an inaccessible object property is isset,empty
_ _ debugInfo: triggered when an object is var_dump
_ _ set_state: triggered when an object is var_export
This is the end of the content of "what are the Magic methods of php7"? thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.