1
0
Fork 0

basic usage - promote safe version range

I'm aware this just an example, but it [leads readers to see it a best practise](40642df5ec (r29802440)).

Having code with `"php": ">=5.4.0"` is pretty dangerous and will probably break with next major version.

```json
{
    "require": {
        "php": "^5.4"
    }
}
```

```json
{
    "require": {
        "php": "^7.1"
    }
}
```

is much more safer. Promoting best and proven practise should from *Basic usage* helps people to use composer the best way they can.

What do you think?
pull/7483/head
Tomáš Votruba 2018-07-23 18:49:39 +02:00 committed by GitHub
parent 00fdb5555c
commit 10f707e316
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -190,11 +190,11 @@ installed on the system but are not actually installable by Composer. This
includes PHP itself, PHP extensions and some system libraries.
* `php` represents the PHP version of the user, allowing you to apply
constraints, e.g. `>=5.4.0`. To require a 64bit version of php, you can
constraints, e.g. `^7.1`. To require a 64bit version of php, you can
require the `php-64bit` package.
* `hhvm` represents the version of the HHVM runtime and allows you to apply
a constraint, e.g., `>=2.3.3`.
a constraint, e.g., `^2.3`.
* `ext-<name>` allows you to require PHP extensions (includes core
extensions). Versioning can be quite inconsistent here, so it's often