开发者

Why can't I declare a function name "_"?

开发者 https://www.devze.com 2023-03-30 03:29 出处:网络
Code: function _() { echo开发者_Go百科 \'hello word\'; } Output: Fatal error: Cannot redeclare _() I haven\'t defined this function _ before, then why I am getting this error? _() is an alias f

Code:

function _()
{
    echo开发者_Go百科 'hello word';
}

Output:

Fatal error: Cannot redeclare _()

I haven't defined this function _ before, then why I am getting this error?


_() is an alias for gettext.


_ is an alias for gettext, a built-in function. Just as you cannot declare a function gettext, you can't create a function _ since one is already there.

0

精彩评论

暂无评论...
验证码 换一张
取 消