此方法僅在參數的預設值設定為命名常數時才會返回 true。例如:
class Foo {
const OPTION_MULTIGET = 1;
//方法 1
public function setGetOptions($opts=0);
//方法 2
public function setMultiGetOptions($opts=Foo::OPTION_MULTIGET);
}
方法 1 的第一個 ReflectionParameter 將返回 isDefaultValueConstant() = false(0 是一個「常數」/靜態值,但不是命名常數),而方法 2 的將返回 isDefaultValueConstant() = true。