PHP 5.3 之前如何使用匿名函数? [英] How to use anonymous functions before PHP 5.3?

查看:32
本文介绍了PHP 5.3 之前如何使用匿名函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 5.3 功能匿名函数的类(https://github.com/JeffreyWay/Easy-WordPress-Custom-Post-Types/blob/master/jw_custom_posts.php),但是有一个问题,在服务器上我无法升级到5.3.是否有任何简单的解决方法可以摆脱匿名函数,或者我是否需要重写整个类?

I have a class that uses 5.3 feature anonymous function (https://github.com/JeffreyWay/Easy-WordPress-Custom-Post-Types/blob/master/jw_custom_posts.php), but there is a problem, on the server I can not upgrade to 5.3. Is there any simple workaround to get rid of anonymous functions or do I need to rewrite whole class?

推荐答案

您有两个选择:

  • 使用支持匿名功能的 PHP 版本更改托管
  • 重新编写您的代码,使其适用于您拥有的 PHP 版本

这篇关于PHP 5.3 之前如何使用匿名函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆