Dutch PHP Conference 2025 - Call For Papers

EventConfig::requireFeatures

(PECL event >= 1.2.6-beta)

EventConfig::requireFeaturesEnters a required event method feature that the application demands

Опис

public EventConfig::requireFeatures( int $feature ): bool

Enters a required event method feature that the application demands

Параметри

feature

Bitmask of required features. See EventConfig::FEATURE_* constants

Значення, що повертаються

Повертає true у разі успіху або false в разі помилки.

Приклади

Приклад #1 EventConfig::requireFeatures() example

<?php
$cfg
= new EventConfig();

// Create event_base associated with the config
$base = new EventBase($cfg);

// Require FDS feature
if ($cfg->requireFeatures(EventConfig::FEATURE_FDS)) {
echo
"FDS feature is now required\n";

$base = new EventBase($cfg);
(
$base->getFeatures() & EventConfig::FEATURE_FDS)
and print
"FDS - arbitrary file descriptor types, and not just sockets\n";
}
?>

Поданий вище приклад виведе щось схоже на:

FDS feature is now required
FDS - arbitrary file descriptor types, and not just sockets

Прогляньте також

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top