See this name, is not a very high-level feeling. Yes, the Magic method is really advanced. So, what is a magic method? The method, which begins with two underscores in PHP, is known as the "Magic Method" (Magic methods). such as __construct (), __destruct (), __clone (), and __call (), __get (), __set (), __sleep (), __wakeup (), __tostring (), __ AutoLoad () and so on, are all magic methods. If you want PHP to invoke these magic methods, you must first define them in the class, otherwise PHP will not execute the Magic method that was not created. Note: The Magic method is set in PHP, so you can't create it yourself, you can only use PHP in the original, otherwise it will error. Here we introduce the magic methods used in many magic methods. The __get () function is: __get (): Read the value of the Inaccessible property (private,protected, not present), p
1. Magic Method __get () Example (PHP Object-oriented Advanced Tutorial 2)
Introduction: See this name, is not a very high-level feeling. Yes, the Magic method is really advanced. So, what is a magic method? The method, which begins with two underscores in PHP, is known as the "Magic Method" (Magic methods). such as __construct (), __destruct (), __clone (), and __call (), __get (), __set (), __sleep (), __wakeup (), __tostring (), __ AutoLoad () and so on, are all magic methods.
2. PHP Object-oriented-object serialization serialize (), __sleep (), __wakeup () code
Introduction: Sometimes need to put an object in the network transmission, in order to facilitate the transmission, the entire object can be converted into a binary string, until the other end, then revert to the original object, this process is called serialization (also known as serialized) serialization, It's like we're going to ship a car to the United States by ship, because the car is bigger, we can take the car into smaller parts, and then we ship the parts to the United States by wheel, and then we assemble the parts back into the car. There are two cases where we have to serialize the object, and the first case is to put a
3. Explain the thread concession yield () and thread Sleep Sleep () method in Java
Summary: The thread concession in Java gives the thread a priority, while hibernation causes the thread to go into a blocking state waiting to be woken up, where we compare the thread-waiting Wait () method to explain the thread concession yield () and the Thread Sleep Sleep () method in Java
4. PHP sleep () function, Usleep () function
Introduction: This article mainly introduces the PHP sleep () function, Usleep () function, the need for friends can refer to the following
5. Python Thread Grooming
Summary: Threads have five new states, ready, running, blocked, and dead. There are three cases of blocking: synchronous blocking refers to a state in a competitive lock, when a thread requests a lock, it enters this state, once the lock is successfully acquired and then resumes to the running state, while waiting for blocking is the state that waits for another thread to be notified, and the thread obtains a conditional lock, the call "Wait" will enter this state, The thread enters the synchronization blocking state, competes for the condition lock again, while the other blocking refers to calling Time.sleep (), Anotherthread.join (...).
6. Php Magic Method
Introduction: __construct (), __destruct (), __call (), __callstatic (), __get (), __set (), __isset (), __unset (), __sleep (), __wakeup () , __tostring (), __invoke (), __set_state () and __
7. Php-serializable interface
Summary: Customize the serialized interface. Classes that implement this interface will no longer support __sleep () and __wakeup (). The Serialize method is called whenever an instance needs to be serialized. It will not call __destruct () or have other effects unless this method is programmed to be called. When the data is deserialized, the class is aware and calls the appropriate unserialize () method instead of calling __construct (). If you need to implement a standard constructor, you should handle it in this method.
8. PHP Common functions (1)
Introduction: In the daily development, most novice is very puzzled, so many PHP built-in function how to remember, in fact, you just know that there is this thing is OK, use more when you naturally remember, the following collection of PHP development when the most commonly used functions, I hope to help you. Some of the commonly used functions of PHP usleep () function delay code execution several microseconds. The unpack () function unpack the data from a binary string. The Uniqid () function generates a unique ID based on the current time in microseconds. Time_s ...
9. PHP Common function "up"
Introduction: In the daily development, most novice is very puzzled, so many PHP built-in function how to remember, in fact, you just know that there is this thing is OK, use more when you naturally remember, the following collection of PHP development when the most commonly used functions, I hope to help you. Some of the commonly used functions of PHP usleep () function delay code execution several microseconds. The unpack () function unpack the data from a binary string. The Uniqid () function generates a unique ID based on the current time in microseconds. Time_s ...
10. Am I the only one who feels that these two words contradict each other?
Summary: Note:max_execution_time only affects the time that the script itself runs. Any other time spent outside of the script, such as the use of the function system () call to the systems, the use of the sleep () function, database queries, file uploads, etc., in the calculation of the script to run the maximum time is not ...
"Related question and answer recommendation":
Does PHP sleep () consume a lot of resources?
How is C + + compatible with Linux and Windows?
PHP-Am I the only one who thinks these two words contradict each other?
What is the mechanism of the JavaScript call function for DOM update?
Java-The main thread exits when the child thread does not end