I've been working with PHP for some time now, and recently I started exploring the use of attributes. Although I find them quite useful, I have come across some doubts regarding their use. Can someone please guide me on any limitations or restrictions when using attributes in PHP?
I understand that attributes provide a way to add metadata to classes, methods, properties, and even parameters. They seem to offer great flexibility for adding additional information to our code. However, as with any feature, I'm sure there must be some limitations or restrictions that we need to consider while using attributes.
I would really appreciate if someone could shed some light on this aspect. Are there any specific scenarios or cases where attributes cannot be applied? Are there any restrictions on the number of attributes that can be used on a single entity? Can attributes have dependencies or interdependencies when used together? It would be really helpful to know if there are any best practices or guidelines associated with the use of attributes in PHP.
Thank you in advance for your insights!