3 ms·
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
by nilslindemann 2y ago
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?
- tored 2y agoYes, you can read about it the rfc under "Abbreviated syntax" https://wiki.php.net/rfc/property-hooks https://wiki.php.net/rfc/property-hooks It follows the syntax of arrow functions https://www.php.net/manual/en/functions.arrow.php https://www.php.net/manual/en/functions.arrow.php
- nilslindemann 2y agoAhhh, and the backslash is the global namespace, as I just figured out: https://stackoverflow.com/questions/4790020/what-does-a-backslash-in-front-of-function-names-mean https://stackoverflow.com/questions/4790020/what-does-a-back...