gpt4 book ai didi

php - PHP 函数声明上方的奇怪注释

转载 作者:可可西里 更新时间:2023-11-01 13:36:40 26 4
gpt4 key购买 nike

我注意到很多脚本都有这些类型的注释:

/**
* Retrieve list of themes with theme data in theme directory.
*
* The theme is broken, if it doesn't have a parent theme and is missing either
* style.css and, or index.php. If the theme has a parent theme then it is
* broken, if it is missing style.css; index.php is optional. The broken theme
* list is saved in the {@link $wp_broken_themes} global, which is displayed on
* the theme list in the administration panels.
*
* @since 1.5.0
* @global array $wp_broken_themes Stores the broken themes.
* @global array $wp_themes Stores the working themes.
*
* @return array Theme list with theme data.
*/
function get_themes() {
global $wp_themes, $wp_broken_themes;

...

return $wp_themes;
}

它看起来像是函数的某种文档,但是以 @ 开头的单词是怎么回事?

像@since、@global、@return、@access、@param 等...?

我知道他们的意思,但为什么他们前面有@?他们需要识别某种文档应用程序吗?

最佳答案

这是 JavaDoc 标准。作者选择它很可能是因为大多数 IDE 会自动很好地格式化它。

http://en.wikipedia.org/wiki/Javadoc

关于php - PHP 函数声明上方的奇怪注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5924528/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com