- reset: documentation ( source)
<?php
$callable = fn() => throw new Exception();
// $value is non-nullable.
// $value = $nullableValue ?? throw new InvalidArgumentException();
// $value is truthy.
$value = $falsableValue ?: throw new InvalidArgumentException();
// $value is only set if the array is not empty.
$value = !empty($array)
? reset($array)
: throw new InvalidArgumentException();