Hello,
We remember the old days, when we had to do:
function getUnreadDocuments(): int {
$user = Auth::user();
if (is_null($user)) return 0;
$documents = $user->getDocuments();
if (is_null($documents)) return 0;
// actual logic of the function
return 42;
}
And it was already really nice to do:
Hello!
With PHP8 released and the named arguments RFC being implemented, there's
now an inconsistency in how the spread operator works.
Historically, the spread operator was first used in PHP 5.6 for arguments:
function php56($a, $b) {
return $a + $b;
}
$test = [1, 2];
php56(...$test) === 3;