Anonymous functions pre PHP 5.3.0

前端 未结 3 1761
抹茶落季
抹茶落季 2020-12-11 22:45

Is there an alternative to anonymous functions in versions of PHP previous to 5.3.0?

3条回答
  •  温柔的废话
    2020-12-11 23:23

    There are two choices.

    First is to create a function, inside a function. Unfortunately, it will pollute the global namespace.

    The second choice is to use create_function.

提交回复
热议问题