Morning Internals,
I'd like to announce a RFC to allow omitting the type declarations for
parameters in subclasses:
https://wiki.php.net/rfc/parameter-no-type-variance
PHP doesn't currently allow variance for parameters as checking these for
compatibility isn't possible on compile time.
This limi
On Mon, Nov 21, 2016 at 9:40 AM Niklas Keller wrote:
> Morning Internals,
>
> I'd like to announce a RFC to allow omitting the type declarations for
> parameters in subclasses:
> https://wiki.php.net/rfc/parameter-no-type-variance
>
> PHP doesn't currently allow variance for parameters as checkin
What happens if the method signature is defined within an interface? I
would consider that method signature a contract and one that should not
be able to be overwritten.
--
Daniel Morris
dan...@honestempire.com
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http:/
2016-11-21 11:00 GMT+01:00 Daniel Morris :
> What happens if the method signature is defined within an interface?
Just the same as for every class. Having other rules for interfaces doesn't
make sense.
Imagine the following example:
interface I { function foo(array $foo); }
class C1 implements
On 11/21/2016 10:39 AM, Niklas Keller wrote:
> Morning Internals,
>
> I'd like to announce a RFC to allow omitting the type declarations for
> parameters in subclasses:
> https://wiki.php.net/rfc/parameter-no-type-variance
>
> PHP doesn't currently allow variance for parameters as checking these
But this leads to code that can't pass static inspections?
interface Joiner {
public function join(array $array): string;
}
class WideJoiner implements Joiner {
public function join($iterable): string {
$array = is_array($iterable) ? $array :
iterable_to_array($iterable);
>
> But this leads to code that can't pass static inspections?
>
No.
> interface Joiner {
> public function join(array $array): string;
> }
>
> class WideJoiner implements Joiner {
> public function join($iterable): string {
> $array = is_array($iterable) ? $array :
> iterable_to
On Mon, Nov 21, 2016 at 10:39 AM, Niklas Keller wrote:
> Morning Internals,
>
> I'd like to announce a RFC to allow omitting the type declarations for
> parameters in subclasses:
> https://wiki.php.net/rfc/parameter-no-type-variance
>
> PHP doesn't currently allow variance for parameters as check