Changes in new versions / PHP 8.2

// *** before: ***
/**
 * @return false|resource
 */
function tryOpen(string $path) {
    // "false" and "null" as types only exist in the docblock
    return @fopen($path, 'r') ?: false;
}

// *** in version 8.2: ***
function isEnabled(): true {
    return true// the type itself guarantees the only possible value
}

function findUser(int $id): User|null {
    return $id > 0 ? new User($id) : null;
}