This is the official website.
caret#
The ^ operator behaves very similarly but it sticks closer to semantic versioning, and would always allow non-breaking UPDA Tes. For example ^1.2.3 are equivalent to >=1.2.3 <2.0.0 as none of the releases until 2.0 should break backwards Compatib Ility. For pre-1.0 versions It also acts with safety on mind and treats ^0.3 as >=0.3.0 <0.4.0.
This was the recommended operator for maximum interoperability when writing library code.
Example: ^1.2.3
Composer
Reply content:
This is the official website.
caret#
The ^ operator behaves very similarly but it sticks closer to semantic versioning, and would always allow non-breaking UPDA Tes. For example ^1.2.3 are equivalent to >=1.2.3 <2.0.0 as none of the releases until 2.0 should break backwards Compatib Ility. For pre-1.0 versions It also acts with safety on mind and treats ^0.3 as >=0.3.0 <0.4.0.
This was the recommended operator for maximum interoperability when writing library code.
Example: ^1.2.3
Composer
@ Charles ~
and ^
The meaning is very close, in x.y
the case is the same is represented x.y <= 版本号 < (x+1).0
, but in the case of the version number is x.y.z
the difference, for example:
See: https://getcomposer.org/doc/a ...
Thanks @ North Moon Samurai
^ Symbolic meaning, used to match next important version
Example:
Composer.json
{ "require": { "topthink/framework": "^5.0-rc1" }}
The following results are performed after sudo composer install
Match to the latest important version of the Composer Library Detail page
Https://packagist.org/package ...
Another remark: Make this mistake is because of a precondition, I generally only care about the minor version number, but do not care about the correction number, so if you always specify ~X.Y and ^x.y is exactly the same, even if the library version number is the version of the X.Y.Z specification named