Anonymous functions pre PHP 5.3.0

前端 未结 3 1764
抹茶落季
抹茶落季 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:20

    There is create_function but it generally isn't recommended. If you're using OOP, you'd be better off defining a one-off private member to use with a callback instead.

提交回复
热议问题