According to the composer documentation:
Caret
The Operator behaves very similarly but it sticks Closer to semantic
versioning, and will Always allow non-breaking updates. For example
1.2.3 is equivalent to >=1.2.3 <2.0.0 as None of the releases until
2.0 should break Backwards Compatibility. For pre-1.0 versions it also Acts with Safety in Mind and Treats 0.3 as >=0.3.0 <0.4.0.
My translation:
The operator ^
behaves very similar, but more attached to semantic versions, and will always allow updates without breaks. For example, ^1.2.3
is equivalent to >=1.2.3 <2.0.0
, that none of the launches until 2.0
should break compatibility with previous versions.
For versions with values lower than 1.0
also acts safely in mind and treats ^0.3
as >=0.3.0 <0.4.0
.
This is the recommended operator for maximum interoperability when writing library code.
That is, when I use ^1.2.3
, I’m telling the Commie "install from version 1.2.3 and, if updates are available, only update if it is smaller than version 2.0.0".
I believe Composer did this because the first number of the versioning sequence indicates that the library has changed significantly and will be dependent on the PHP version you use. That means "updates without break" quoted earlier.
If you want to define that your installation will assume the semantic version as 1.1
, then you must specify in your Composer installation
composer require crphp/check 1.1.*
Or
composer require crphp/check ^1.1