That will not work because this is to be implemented in a WordPress plugin that is installed on various websites either having PHP 5.6 or PHP 7.1+. So, it needs to have both versions installed and detect which PHP version is used and load the package accordingly. This can be easily done in PHP, but when it comes to Composer, I need to implement this effectively and I'm out of ideas. The library they provide work well with Composer and they highly recommend it.
I need to implement T-Regx library - https://github.com/T-Regx/T-Regx - in a project that might be running in PHP 5.6 or PHP 7.1+, depending on which version the server has installed. So, on PHP 5.6, I need to run package #1 and on PHP 7.1+ package #2. However, whenever I install the package it creates the directory /vendor/rawr/t-regx/ - I need to have something like /vendor/rawr/t-regx-5.6/ and /vendor/rawr/t-regx-7-1-plus/ and composer should trigger the needed one based on the PHP version. I need this because plenty of people still use PHP 5.6 and I can't just tell them to upgrade (it's not that simple). If I use a PHP 5.6 package and the user has PHP 8 installed, there will be errors shown that would annoy the user. Any suggestions? I'm sure other users are having this issue.