logo
LIS PUBLICA
☰
  • Новое
  • Горячее
  • Сокровищница
  • Лучшее
  • Сообщества
  • Видео
  • Обсуждаемое
  • Поиск

ne_takoi
ne_takoi Опубликовано 20 часов назад
  • [моё]
  • Rj-45

Huyy

3
    /**
 * @template T
 * @param callable(): (T|false) $function
 * @return T
 * @throws \ErrorException
 */
function exceptionally(
    callable $function,
    int $errorLevels = E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED,
): mixed {}

// PHP < 8.6
$contents = exceptionally(static fn () => file_get_contents($file));

// PHP >= 8.6 с partial function application
$contents = exceptionally(file_get_contents($file, ...));
Plp
    /**
 * @template T
 * @param callable(): (T|false) $function
 * @return T
 * @throws \ErrorException
 */
function exceptionally(
    callable $function,
    int $errorLevels = E_ALL &amp; ~E_DEPRECATED &amp; ~E_USER_DEPRECATED,
): mixed {}

// PHP &lt; 8.6
$contents = exceptionally(static fn () =&gt; file_get_contents($file));

// PHP &gt;= 8.6 с partial function application
$contents = exceptionally(file_get_contents($file, ...));
Читать дальше...
0
+0 / -0
0%
1
ne_takoi
ne_takoi ТС Опубликовано 20 часов назад
    /**
 * @template T
 * @param callable(): (T|false) $function
 * @return T
 * @throws \ErrorException
 */
function exceptionally(
    callable $function,
    int $errorLevels = E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED,
): mixed {}

// PHP < 8.6
$contents = exceptionally(static fn () => file_get_contents($file));

// PHP >= 8.6 с partial function application
$contents = exceptionally(file_get_contents($file, ...));
0
+0 / -0
Войти

Вход

Регистрация

Я не помню пароль

Войти через Google
Порог горячего 3
Правила сайта
Пользовательское соглашение
О ПД
Принципы самоуправления
FAQ
Нашёл ошибку?
©2026 Varius Soft