略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: EventBase::getFeatures

2024-12-22

EventBase::getFeatures

(PECL event >= 1.2.6-beta)

EventBase::getFeaturesReturns bitmask of features supported

说明

public EventBase::getFeatures(): int

Returns bitmask of features supported.

参数

此函数没有参数。

返回值

Returns integer representing a bitmask of supported features. See EventConfig::FEATURE_* constants .

范例

示例 #1 EventBase::getFeatures() example

<?php
// Avoiding "select" method
$cfg = new EventConfig();
if (
$cfg->avoidMethod("select")) {
    echo 
"'select' method avoided\n";
}

$base = new EventBase($cfg);

echo 
"Features:\n";
$features $base->getFeatures();
(
$features EventConfig::FEATURE_ET) and print("ET - edge-triggered IO\n");
(
$features EventConfig::FEATURE_O1) and print("O1 - O(1) operation for adding/deletting events\n");
(
$features EventConfig::FEATURE_FDS) and print("FDS - arbitrary file descriptor types, and not just sockets\n");
?>

参见

add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/eventbase.getfeatures.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3