4 ms·
I went to look at array accessor overloading today and saw “Property Hooks” in the sidebar (under “Classes and Objects”). I didn’t know what they were, so I cl
by LeftHandPath 2y ago
I went to look at array accessor overloading today and saw “Property Hooks” in the sidebar (under “Classes and Objects”).
I didn’t know what they were, so I clicked. I was bewildered that I had never run into them before, used them in my own code, or seen them used by others. Come to find out they’ve only been around for about a day!
Reminds me of some of the lovely expressibility and syntactic sugar that’s pulled me to other languages lately. Glad to see it make its way into PHP.
- 9dev 2y agoThe next thing I would love to see adapted would by Python—style array access: $foo[1:-3:2] Instead of the usual array functions, which could stick around for BC. That would be amazing