Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<About event persistenceConstructing signal events>
^EventLast updated: Mon, 26 Oct 2026

Event callbacks

If a callback is registered for an event, it will be called when the event becomes active. To associate a callback with event one can pass a callable to either Event::__construct(), or Event::set(), or one of the factory methods like Event::timer().

An event callback should match the following prototype:

function callback( mixed $fd = null , int $what = ?, mixed $arg = null ): void
fd

The file descriptor, stream resource or socket associated with the event. For signal event fd is equal to the signal number.

what

Bit mask of all events triggered.

arg

User custom data.

Event::timer() expects the callback to match the following prototype:

function callback( mixed $arg = null ): void
arg

User custom data.

Event::signal() expects the callback to match the following prototype:

function callback( int $signum = ?, mixed $arg = null ): void
signum

The number of the triggered signal(e.g. SIGTERM ).

arg

User custom data.


<About event persistenceConstructing signal events>
^EventLast updated: Mon, 26 Oct 2026