πŸ“Š PHP
Q. Which magic method is used to return a string representation of an object?
  • (A) __toString()
  • (B) __string()
  • (C) __print()
  • (D) __str()
πŸ’¬ Discuss
βœ… Correct Answer: (A) __toString()

Explanation: __toString() is used when an object is treated like a string.

Explanation by: Rati Dubey
__toString() is used when an object is treated like a string.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
63
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Rati Dubey
Publisher
πŸ“ˆ
93%
Success Rate