Must be `foreach($list as &$path)`, not `foreach ($list as &$path)`.