Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Talk:Plugin API/Filter Reference/login redirect

Use of anonymous function as an example is completely acceptable. Yes, it does only work in PHP 5.3+ and the code example states this. While WordPress currently supports 5.2.4+, that is to be considered an absolute minimum requirement. No one in their right mind runs anything that low as the current version is 7.1 and anything below 5.6 is EOL'd; and besides, discussion is already in place for raising the WP minimum requirement (as many plugins actually have already done).

Obviously, in something like core, an anonymous function would be unacceptable. Likewise, it would be unwise for a theme or plugin and would be considered non-standard. However, when discussing code snippets and examples that's another story entirely. The codex is a place to show examples, and when properly labeled, an example of an anonymous function not only is acceptable, it adds value.