The difference between "1. *" and "1.x" in composer requires

If you require a package in your composer.json file, what's the difference between:

"require": {
    "SomePackage": "1.*"
}

      

and

"require": {
    "SomePackage": "1.x"
}

      

or are they both the same?

+3


source to share


1 answer


From source code :

325.   // match wildcard constraints
326.   if (preg_match('{^(\d+)(?:\.(\d+))?(?:\.(\d+))?\.[x*]$}', $constraint, $matches)) {
                                                         ^^

      



In this regex, you can see that there is x

indeed an undocumented alias *

.

+3


source







All Articles