How to alias a function in PHP?

前端 未结 15 1239
死守一世寂寞
死守一世寂寞 2020-11-30 00:13

Is it possible to alias a function with a different name in PHP? Suppose we have a function with the name sleep. Is there a way to make an alias called wa

15条回答
  •  猫巷女王i
    2020-11-30 00:46

    You can look at lambdas also if you have PHP 5.3

    $wait = function($v) { return sleep($v); };
    

提交回复
热议问题