(PECL event >= 1.2.6-beta)
EventBase::getFeatures — 傳回支援的功能位元遮罩
此函式沒有參數。
傳回表示支援功能位元遮罩的整數。請參閱 EventConfig::FEATURE_* 常數。
範例 #1 EventBase::getFeatures() 範例
<?php
// 避免使用 "select" 方法
$cfg = new EventConfig();
if ($cfg->avoidMethod("select")) {
echo "已避免使用 'select' 方法\n";
}
$base = new EventBase($cfg);
echo "特性:\n";
$features = $base->getFeatures();
($features & EventConfig::FEATURE_ET) and print "ET - 邊緣觸發式 IO\n";
($features & EventConfig::FEATURE_O1) and print "O1 - O(1) 複雜度的事件新增/刪除操作\n";
($features & EventConfig::FEATURE_FDS) and print "FDS - 支援任意檔案描述符類型,而不僅僅是 sockets\n";
?>