"If a parameter with a default value is followed by a required parameter, the default value has no effect."
This is deprecated as of PHP 8.0.0 and can generally be resolved
- by dropping the default value
- by changing the position of parameters as suggested above
, without a change in functionality.
This method worked in my case =)
I was facing the following error :
ErrorException Required parameter $id follows optional parameter $getLink
Following code was generating this Exception
public function fo($getLink = null , $id)
{ ......
}
To Solve this error, I Changed the position of the parameters as suggested in the following code :
public function fo($id, getLink = null)
{ ......
}
Done =)