Reference – Composer error “Your PHP version does not satisfy requirements” after upgrading PHP

The Problem As well as the versions of other packages they require, Composer packages can specify the versions of PHP which they support. While resolving the versions of packages to install, Composer has to find versions which match all the constraints in place: The version constraints you’ve specified for dependencies in your composer.json The version … Read more

Required parameter $xxx follows optional parameter $yyy

This style of function declaration has been deprecated in PHP 8.0. Writing functions like this has never made sense, since all parameters (up to the last required one) would need to be specified when the function was called. It also caused confusion with use of the ReflectionFunctionAbstract class to analyze functions and methods. The new … Read more

Does PHP allow named parameters so that optional arguments can be omitted from function calls?

No, it is not possible (before PHP 8.0): if you want to pass the third parameter, you have to pass the second one. And named parameters are not possible either. A “solution” would be to use only one parameter, an array, and always pass it… But don’t always define everything in it. For instance : … Read more