Merge pull request #15154 from mfn/mfn-php8-compat

[2.x] php-8.0-compat: fix "Error: Unknown named parameter $subject"
This commit is contained in:
Mark Story 2020-11-28 13:49:09 -05:00 committed by GitHub
commit da9f6991c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -126,7 +126,7 @@ abstract class ObjectCollection {
} }
$result = null; $result = null;
foreach ($list as $name) { foreach ($list as $name) {
$result = call_user_func_array(array($this->_loaded[$name], $callback), array_filter(compact('subject')) + $params); $result = call_user_func_array(array($this->_loaded[$name], $callback), array_values(array_filter(compact('subject')) + $params));
if ($options['collectReturn'] === true) { if ($options['collectReturn'] === true) {
$collected[] = $result; $collected[] = $result;
} }