There is a general method __toString () method in PHP object-oriented. The following description or definition error about this method is ():
A. This method is a method that is called automatically when directly outputting an object reference.
B. If this method is not defined in the object, using echo to output this object directly will report the following error: Catchable fatal error: Object of class A could not be converted to string.
C. There must be a string in this method as the return value.
D. This method is used to output information, as follows: public function __toString () {echo "This is Class ….";}
Answer:D
There is a general method __toString () method in PHP object-oriented. The following description or definition error about this method is ():
A. This method is a method that is called automatically when directly outputting an object reference. B. If this method is not defined in the object, using echo to output this object directly will report the following error: Catchable fatal error: Object of class A could not be converted to string. C. There must be a string in this method as the return value. D. This method is used to output information, as follows: public function __toString () {echo "This is Class ….";}