I'm relatively new to PHP and I've been trying to understand the concept of attributes in PHP. I have come across the terms "comments" and "annotations" in relation to PHP as well, but I'm not quite sure how they differ from attributes.
From what I can gather, comments are essentially used to add explanations or descriptive text within the code, but they are not interpreted as part of the program itself. They are more for developers to document their code or provide information to other developers who might work on the same project.
On the other hand, annotations seem to be a way of adding metadata or additional information to classes, methods, or properties, and they can be used by frameworks or libraries for various purposes like dependency injection, routing, or validation.
Now, when it comes to attributes, I'm a bit confused. Are they similar to annotations? Or are they something entirely different? How do attributes in PHP differ from comments or annotations?
I would really appreciate it if someone could shed some light on this topic and help me understand the distinctions between attributes, comments, and annotations in PHP.
Thanks in advance!