On 30/05/2017 07:24, Rasmus Schultz wrote:
The type widening RFC makes it easier to move to parameter types for
existing 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.

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]


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to