Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Composer version symbol cheatsheet
...
"require": {
    "vendor/package": "1.3.2", // exactly 1.3.2 (exact)

    // >, <, >=, <= | specify upper / lower bounds
    "vendor/package": ">=1.3.2", // anything above or equal to 1.3.2
    "vendor/package": "<1.3.2", // anything below 1.3.2

    // * | wildcard
    "vendor/package": "1.3.*", // >=1.3.0 <1.4.0

    // ~ | allows last digit specified to go up
    "vendor/package": "~1.3.2", // >=1.3.2 <1.4.0
    "vendor/package": "~1.3", // >=1.3.0 <2.0.0

    // ^ | doesn't allow breaking changes (major version fixed - following semvar)
    "vendor/package": "^1.3.2", // >=1.3.2 <2.0.0
    "vendor/package": "^0.3.2", // >=0.3.2 <0.4.0 // except if major version is 0
}
@Morgy93

This comment has been minimized.

Copy link

commented Jun 30, 2017

@decadence

This comment has been minimized.

Copy link

commented Aug 14, 2017

@promatik

This comment has been minimized.

Copy link

commented Sep 12, 2018

Do you know the meaning of the symbols ! and ~ when running composer outdated?

almasaeed2010/adminlte      v2.4.3 ! v2.4.8 AdminLTE - admin control ...
nesbot/carbon               1.33.0 ~ 2.1.0  A simple API ...
phpdocumentor/type-resolver 0.4.0  ~ 0.7.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.