Composer 1.7 and the platform check you can now write down

A machine with PHP 7.2 installing dependencies for a server running 7.1 resolves to packages the server cannot run, and the failure happens on deploy rather than on install.

{
    "config": {
        "platform": {
            "php": "7.1.33",
            "ext-redis": "4.1.0"
        }
    }
}

This tells the resolver to pretend it is the production platform regardless of what the local machine has, so a package requiring 7.2 is rejected at install time where it can be dealt with. It does not prevent you running the code locally — it constrains resolution only. Keeping the value in step with the servers is manual and worth a line in the deploy checklist, because a stale platform setting silently holds a project back a version.