0

Just to make something clear, when my Magento 2 module state:

   "require": {
    "php": "^7.1.0"
},

Does that mean that the module support PHP version 7.1 and higher or only 7.1?

2

Although the question is not directly related to Magento, but I would like to answer. Composer.json file uses mainly 3 symbols, i.e. tilde (~), caret (^), wildcard ( * ).

Here is the difference:

First lets take a look at tilde (~) symbol:

~3.1.2 means >= 3.1.2,< 3.2.0,
~3.1   means >= 3.1.0,< 4.0.0,
~0.3   means >= 0.3.0,< 1.0.0,
~3     means >= 3.0.0,< 4.0.0.

The caret (^) symbol is a bit different:

^3.1.2 means >= 3.1.2,< 4.0.0,
^3.1   means >= 3.1.0,< 4.0.0 (just like ~3.1),
^0.3   means >= 0.2.0,< 0.4.0,
^3     means >= 3.0.0,<4.0.0 (As it is like ~3)

While wildcard ( * ) means value lies between 0 to 9

I hope it helped.

2
  • So when my Magento 3rd party says ^7.1.0 it will support our PHP version on Magento which is 7.3? – Jan-petter Havna Jun 11 at 12:19
  • 1
    @Jan-petterHavna Yes - it will suport anything greater than 7.1 but less than 8.0. There is a useful website you can use to test it out here - jubianchi.github.io/semver-check/# – Paul Jun 11 at 12:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.