phpdoc 标准用于设置可选参数的默认值?
例:
/**
* This function will determine whether or not one string starts with another string.
* @param string $haystack <p>The string that needs to be checked.</p>
* @param string $needle <p>The string that is being checked for.</p>
* @param boolean $case[optional] <p>Set to false to ignore case(capital or normal characters)</p>
* @return boolean <p>If the $haystack string does start with the $needle string, the return will be true. False if not.</p>
*/
function endsWith($haystack,$needle,$case=true) {
if($case){return (strcmp(substr($haystack, strlen($haystack) - strlen($needle)),$needle)===0);}
return (strcasecmp(substr($haystack, strlen($haystack) - strlen($needle)),$needle)===0);
}
默认情况下,可选参数设置为。我希望在文档中指出默认设置是什么。有没有一种标准的方法可以做到这一点,或者我必须在描述中提到它?true