Files

25 lines
522 B
PHP
Raw Permalink Normal View History

2026-03-30 14:54:57 +07:00
<?php
namespace Safe;
use Safe\Exceptions\FunchandException;
/**
2026-04-18 20:32:18 +07:00
* @param callable(): void $callback
2026-03-30 14:54:57 +07:00
* @param mixed $args
* @throws FunchandException
*
*/
function register_tick_function(callable $callback, ...$args): void
{
error_clear_last();
if ($args !== []) {
$safeResult = \register_tick_function($callback, ...$args);
} else {
$safeResult = \register_tick_function($callback);
}
if ($safeResult === false) {
throw FunchandException::createFromPhpError();
}
}