Php object-oriented _ toString () usage details. This article will introduce the usage of the php object-oriented _ toString () method in detail, and the ,__ toString () method is automatically called, this article is automatically called when the
Methods automatically called by objects in PHP: set (), get (), tostring () summary:
(1) _ get ($ property_name): When you get the value of $ name for a private attribute, this object automatically calls this method and passes the attribute name
This article will introduce you to the usage of the php object-oriented _ toString () method. The _ toString () method is automatically called, it is automatically called when an object reference is directly output.
As we have mentioned earlier, the
Summarize:
(1) __get ($property _name): When a private property $name value is obtained, this object automatically calls the method, passing the property name value to the parameter $property_name, through which the internal
Executes, returns the
Php object-oriented full Guide (11) _ toString () usage clone object _ call to handle call errors. 16. _ toString () method we previously mentioned the method for declaring the method name starting with "-" in the class (provided by PHP ), it is
Php _ call _ autoload _ clone _ toString _ sleep. , _ Wakeup explanation 1, _ call ($ method, $ arg_array) when an undefined method is called, a special method _ call () is added to the object in php Tutorial 5. this method and _ wakeup are
This article will introduce you to the usage of the php object-oriented _ toString () method, __tostring () method is automatically called, it is automatically called when an object reference is directly output.
This article will introduce you to
Php object-oriented toString ()
_ ToString ()
When debugging a program, we need to know whether the data is correct. For example, when printing an object, you can check what attributes and values the object has. if the class defines the toString
_ Wakeup
1. _ call_ Call ($ method, $ arg_array) When an undefined method is called
A special method _ call () is added to the object in php tutorial 5, which is used to monitor other
Method. If you try to call a method that does not exist in an
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.