Re: Should new PSRs support PHP5?

2017-10-29 Thread Larry Garfield
"Just put the types in docblocks" is unfortunately insufficient.  Exhibit A: PSR-6 specified a method that needed a date time, and would accept either DateTime or DateTimeImmutable, aka would take DateTimeInterface from PHP 5.5.  At the time we decided to make it a docblock-only type to allow PHP

Re: Should new PSRs support PHP5?

2017-10-29 Thread Lukas Kahwe Smith
> On 28 Oct 2017, at 20:23, Oscar Otero wrote: > > > 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) > So we can keep releasing interfaces compatible with php5 and in a short

Re: Should new PSRs support PHP5?

2017-10-29 Thread Xedin Unknown
That's, actually, my point. Because in coding terms standards are just interfaces, it takes a very small amount of effort to make them compatible. If, instead of type-hinting scalars, you just specify the right types in the docs, that is enough to make a standard. PHP 7 implementations are free