Yes it is possible.
Consider one branch, for example. 1.x for legacy php versions like
{ "name": "some/library", "version": "1.0.0", "require": { "ircmaxell/password-compat": "*" } }
and 2.x for 5.5 +
{ "name": "some/library", "version": "2.0.0", "require": { "php": ">=5.5" } }
Thus, the requirements for the free version, i.e. some/library:* will be allowed to the corresponding versions.
Another way is to tell users to add
"replace": { "ircmaxell/password-compat": "*" }
independently, if necessary.
Please note that some users (including me) can change their php interpreter on the fly and will not be too happy to debug such automatic problems.
estus source share