Am 23.11.2016 um 01:52 schrieb Dan Ackroyd:
Hi,

This is the reintroduction of the Object Type RFC for discussion.

There was previously strong feedback from people who would prefer that
the inheritance checks for methods that use object types should be
co/contravariant. This has been added to the RFC.

https://wiki.php.net/rfc/object-typehint

I like this RFC :)

And I have a question where I'm not sure if that should be catched by this RFC, too:

If I declare a return type of "object" and extends that to return "static" it doesn't compile because "static" is not a valid return type yet.

https://3v4l.org/lp3AB/rfc#version=rfc-typed-properties

class Test {
    public static function factory() : object {
        return new static();
    }
}

class Test2 extends Test {
    public static function factory() : static {
        return parent::factory();
    }
}



cheers
Dan
Ack


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

Reply via email to