When requiring packages in composer.json file, what is the difference between:
"require": {
"SomePackage": "1.*"
}
and
"require": {
"SomePackage": "1.x"
}
or are they both the same thing?
From the source code:
325. // match wildcard constraints
326. if (preg_match('{^(\d+)(?:\.(\d+))?(?:\.(\d+))?\.[x*]$}', $constraint, $matches)) {
^^
You can see in this regexp that x is indeed an undocumented alias to *.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With