Skip to content

Commit

Permalink
Changed call in ClassMapAutoloader to preserve original behaviour
Browse files Browse the repository at this point in the history
In PHP8 the third param of array_walk ($userdata) is automatically
passed by value thus calling a function that expects pass by reference
as the third param is not possible.
Simply changing the array_walk to a foreach loop allows us to fulfill
the pass by reference signature.
  • Loading branch information
Alexander Wozniak authored and glensc committed Mar 15, 2021
1 parent e38f1b2 commit 55a8a19
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,10 @@ public static function realPharPath($path)
$prependSlash = $parts && $parts[0] === '' ? '/' : '';
$parts = array_values(array_filter($parts, array(__CLASS__, 'concatPharParts')));

array_walk($parts, array(__CLASS__, 'resolvePharParentPath'), $parts);
foreach ($parts as $key => $value) {
self::resolvePharParentPath($value, $key, $parts);
}

if (file_exists($realPath = 'phar://' . $prependSlash . implode('/', $parts))) {
return $realPath;
}
Expand Down

0 comments on commit 55a8a19

Please sign in to comment.