From edf121ce11ce1f66c3221757d7b034caeea26fa0 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sat, 4 Jul 2015 11:51:55 +0100 Subject: [PATCH] Minor tweaks, refs #4172 --- doc/articles/versions.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/articles/versions.md b/doc/articles/versions.md index 50af64e7d..5e368bca7 100644 --- a/doc/articles/versions.md +++ b/doc/articles/versions.md @@ -1,5 +1,5 @@ # Versions @@ -24,6 +24,10 @@ You can define multiple ranges. Ranges separated by a space (` `) or comma (`,`) will be treated as a **logical AND**. A double pipe (`||`) will be treated as a **logical OR**. AND has higher precedence than OR. +> **Note:** Be careful when using unbounded ranges as you might end up +> unexpectedly installing versions that break backwards compatibility. +> Consider using the [caret](#caret) operator instead for safety. + Examples: * `>=1.0` @@ -78,6 +82,9 @@ 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`. +This is the recommended operator for maximum interoperability when writing +library code. + Example: `^1.2.3` ## Stability @@ -109,4 +116,3 @@ You can test version constraints using [semver.mwl.be](http://semver.mwl.be). Fill in a package name and it will autofill the default version constraint which Composer would add to your `composer.json` file. You can adjust the version constraint and the tool will highlight all releases that match. -