Re: Parameter type widening RFC
| From: | Rowan Collins | Date: | Tue, 30 May 2017 17:39:07 +0000 |
| Subject: | Re: Parameter type widening RFC | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-99267@lists.php.net to get a copy of this message | ||
On 30/05/2017 07:24, Rasmus Schultz wrote:
That's a good point, and reduces the immediate value of the change slightly, but there is perhaps still value in making upgrading *easier* on users. For instance, you might want to use some other feature of PHP 7.2 anyway, so be willing to set that as your minimum version, but still not want users to have to go through checking all their code for the correct type hints. If they're already using 7.2, they might be able to migrate to your new version without changing a single line of code. Regards, -- Rowan Collins [IMSoP]The type widening RFC makes it easier to move to parameter types forexisting libraries. I'm curious to see how you'll set the version constraint in your composer.json file. After adding a scalar type-hint to an interface, which is a breaking change in 7.0 and 7.1, but a non-breaking change in 7.2, is the new version of your package a major or minor release? If you release it as minor, you'll need a PHP version constraint like "^5.5, ^7.2", but excluding 7.0-7.1 In that way is itself a breaking change, so likely your only practical move is to release (and commit to maintain!) both major and minor versions, which doesn't sound easy at all.