Hacker News new | past | comments | ask | show | jobs | submit login

Non PHP expert here, can someone explain to me the line

get => \sprintf("%s_%s", $this->languageCode, $this->countryCode);

in the first code example? Is it a lambda?






Yes, you can read about it the rfc under "Abbreviated syntax"

https://wiki.php.net/rfc/property-hooks

It follows the syntax of arrow functions

https://www.php.net/manual/en/functions.arrow.php


Ahhh, and the backslash is the global namespace, as I just figured out: https://stackoverflow.com/questions/4790020/what-does-a-back...



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: