且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 PHP 中给函数取别名?

更新时间:2023-09-18 17:59:52

仅限 PHP 5.6+

从 PHP 5.6 开始 可以通过导入来给函数取别名:

PHP 5.6+ only

Starting with PHP 5.6 it is possible to alias a function by importing it:

use function sleep as wait;

文档中还有一个示例(参见函数别名").