Ok, I see. Could this be solved with php 7.2, that implements parameter type widening? (https://wiki.php.net/rfc/parameter-no-type-variance <https://wiki.php.net/rfc/parameter-no-type-variance>) So we can keep releasing interfaces compatible with php5 and in a short future release the v2.0 compatible with php ^7.2. I think that this feature was added specially for things like this.
> El 28 oct 2017, a las 19:54, Michael Cullum <[email protected]> escribió: > > Oscar, > > This was discussed on Slack however those there agreed it didn't make sense > to do releasing new version of the interface for each PHP version. > > The reason being as then you have a client application that has one library > requiring one version, and another library requiring another version which > would be incompatible with each other. > > Implementing libs also couldn't support both 1.x and 2.x if they support PHP > 7 as you can't leave out the type declaration of extending an interface, and > having it in PHP 5 will throw an error. So implementing libs would require > 1.x or 2.x but never both causing the above issue in client applications. > > Michael > > On 28 Oct 2017 11:40 am, "Oscar Otero" <[email protected] > <mailto:[email protected]>> wrote: > I’d like to have a more progressive approach. Something like this: > > v1.0 => PHP 5.6 > v2.0 => PHP 7.0 > v3.0 => PHP 8.0 > etc... > > Defining a way to upgrade packages with no API modifications, but just > requiring newer php version makes the psr more version agnostic. The most > important thing is the api spec, not the features of any php version. Older > php versions makes more use of docblock and newer php versions use the new > syntax features. It’s like progressive enharcement strategy applied to php. > > >> El 28 oct 2017, a las 11:18, 'Alexander Makarov' via PHP Framework >> Interoperability Group <[email protected] >> <mailto:[email protected]>> escribió: >> >> 7.1 should be fine. 7.0 has a limitation for not allowing nulls while >> type-hinted and that's a deal breaker. >> >> On Wednesday, October 25, 2017 at 7:13:54 PM UTC+3, Sara Golemon wrote: >> On Saturday, October 21, 2017 at 4:19:20 PM UTC-4, Tobias Nyholm wrote: >> While reviewing PSR-18 I found a suggestion to make our base exception to >> implement \Throwable. So, should new PSRs support PHP 7 only or do we still >> need PHP 5 support? >> >> Like someone said, "PHP5 is dying, just kill it already". I like to agree >> with that. But at the same time, I do not what the guzzle/buzz community to >> choose between implementing this PSR or supporting PHP5. >> >> I would like the core committee to give me (and other authors of new PSRs) a >> unified recommendation: Should new PSRs support PHP5 or not? >> >> >> Given that PSRs packages are just interfaces, the problem space comes down >> to type hinting and that’s basically it. There’s no need for an interface >> only file to have a declare(strict_types); declaration since it has no >> effect on a file with no real code. The nature of exceptions (implements >> \Throwable versus extends \Exception) falls on the edge of the type hinting >> issue. >> >> >> >> So the question is: How much do we want scalar type hinting (and return type >> hinting, throwable, iterable) in PSRs? Do we want these things enough to >> exclude PHP 5 consumers? More to the point, who is our real audience? I >> don’t think our audience is WordPress (still defining their minimum version >> as 5.2.5). Is our audience a bunch of green fielders who are pulling in >> Symfony 4 (which requires 7.1+) ? >> >> >> My hot take is to generally agree with Larry (7.0+ is reasonable where >> there's a demonstrable benefit, but 7.1 borders on aggressive). I don't >> quite agree that it's /too/ aggressive, but it should be tempered by some >> degree of conservatism. >> >> Personally, I'd like to hear from project reps. What are your various >> positions on minimum versions? >> >> -Sara >> >> -- >> You received this message because you are subscribed to the Google Groups >> "PHP Framework Interoperability Group" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] >> <mailto:[email protected]>. >> To post to this group, send email to [email protected] >> <mailto:[email protected]>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/php-fig/e4b31600-770b-4d26-a9b6-5e0114dd04ee%40googlegroups.com >> >> <https://groups.google.com/d/msgid/php-fig/e4b31600-770b-4d26-a9b6-5e0114dd04ee%40googlegroups.com?utm_medium=email&utm_source=footer>. >> For more options, visit https://groups.google.com/d/optout >> <https://groups.google.com/d/optout>. > > > -- > You received this message because you are subscribed to the Google Groups > "PHP Framework Interoperability Group" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > To post to this group, send email to [email protected] > <mailto:[email protected]>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/php-fig/58C2F471-8E84-4DA7-AEB6-F2E78F3393CC%40gmail.com > > <https://groups.google.com/d/msgid/php-fig/58C2F471-8E84-4DA7-AEB6-F2E78F3393CC%40gmail.com?utm_medium=email&utm_source=footer>. > > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. > > > -- > You received this message because you are subscribed to the Google Groups > "PHP Framework Interoperability Group" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > To post to this group, send email to [email protected] > <mailto:[email protected]>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/php-fig/CAAqcDMj7nuahPK86RVPT%3DQ%2B0fFAqBu0LzZ3tZKuu%2Bi4Q8EEtJA%40mail.gmail.com > > <https://groups.google.com/d/msgid/php-fig/CAAqcDMj7nuahPK86RVPT%3DQ%2B0fFAqBu0LzZ3tZKuu%2Bi4Q8EEtJA%40mail.gmail.com?utm_medium=email&utm_source=footer>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. -- You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/44DA0865-1593-46AF-B3DB-CF5A57966A1E%40gmail.com. For more options, visit https://groups.google.com/d/optout.
