07-21-2023, 01:32 PM
Related to this question you can review [Composer documentation on versions][2], but here in short:
- Tilde Version Range (**~**) - ~1.2.3 is equivalent to >=1.2.3 <**1.3.0**
- Caret Version Range (**^**) - ~1.2.3 is equivalent to >=1.2.3 <**2.0.0**
So, with **Tilde** you will get automatic updates of patches but minor and major versions will not be updated. However, if you use **Caret** you will get patches and minor versions, but you will not get major (breaking changes) versions.
Tilde Version is considered "safer" approach, but if you are using reliable dependencies (well-maintained libraries) you should not have any problems with Caret Version (because minor changes should not be breaking changes.
[1]:
You should probably review [this stackoverflow post about differences between composer install and composer update][1].
- Tilde Version Range (**~**) - ~1.2.3 is equivalent to >=1.2.3 <**1.3.0**
- Caret Version Range (**^**) - ~1.2.3 is equivalent to >=1.2.3 <**2.0.0**
So, with **Tilde** you will get automatic updates of patches but minor and major versions will not be updated. However, if you use **Caret** you will get patches and minor versions, but you will not get major (breaking changes) versions.
Tilde Version is considered "safer" approach, but if you are using reliable dependencies (well-maintained libraries) you should not have any problems with Caret Version (because minor changes should not be breaking changes.
[1]:
[To see links please register here]
[2]:[To see links please register here]
You should probably review [this stackoverflow post about differences between composer install and composer update][1].