One of the unsung heroes of PHP 8 is PHP attributes. Attributes are a language-native way to provide accessible metadata on almost any language construct. Huzzah! Joy! New toys!

So what? What can we actually do with attributes, and how can we make them even more powerful? In particular, what can they replace in our older code?

This session will cover PHP attributes, what they are and how they work, as well as how to make them even more powerful with AttributeUtils, a robust user-space library for working with attributes.

Comments

Please login to leave a comment

Great talk Larry, and thank you for having the slides available before the presentation. Good deep run down into attributes and how to use them. Good to explore the outer reaches of where we can go with them.

This talk has *a lot* of content, but the role and usage of vanilla PHP attributes could be explained better. It's clear that Larry's very proud of AttributeUtils (as he should!), but I would have liked to see less of the "how" and more of the "why."

Myles Hyson at 15:53 on 25 Apr 2024

This was great. I started off as an attribute hater. Now wanting to give them a try in some projects back home.

Tim Lytle at 12:46 on 26 Apr 2024

Really solid talk about what attributes provide in the language, and then a great dive into `AttributeUtils`. Even if that library isn't something you end up using, it's a real world example of what's possible with attributes. Highly recommend for anyone interested in knowing more about what attributes make possible.