Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97145 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30196 invoked from network); 23 Nov 2016 11:26:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Nov 2016 11:26:08 -0000 Authentication-Results: pb1.pair.com header.from=david.proweb@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=david.proweb@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.179 as permitted sender) X-PHP-List-Original-Sender: david.proweb@gmail.com X-Host-Fingerprint: 209.85.217.179 mail-ua0-f179.google.com Received: from [209.85.217.179] ([209.85.217.179:34710] helo=mail-ua0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CA/53-05808-ECC75385 for ; Wed, 23 Nov 2016 06:26:07 -0500 Received: by mail-ua0-f179.google.com with SMTP id 51so10197841uai.1 for ; Wed, 23 Nov 2016 03:26:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=4I4658DDMJxXyYwt3BZGoiPaE43sbnlvYguGcS6JWT8=; b=kmrtqRapZIyejY6roWxqh1bK80gfCa1WTLlOdPYFEoks5d+7YxBn+bW6kVBhrr6akL gbosL6Qu3G7+Gtsa8qsui4yITmcFNKwLBZHUk/zpO9wAcrmfN3Esinu4Kf91oaEaES0o gGZnut9M2sUPyTnpm0cnLbAH04DAa5oUCYw2BBzRhYW0tmXQVWIOgqZz7iMKWzB3mbRZ WNZav/YQl4qe7LXN3bQrOZw5NRVwlOroQI6CXDwGEqYiB4yoescPhdPLrTNrl8eXuTUg Vk40CHgl3pX4BJq9ngFd58RGTAu8TTDKrYEgSP4pz2oJzFRU+BNnl+u9L7WK7aELZce1 FlBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=4I4658DDMJxXyYwt3BZGoiPaE43sbnlvYguGcS6JWT8=; b=mP6NoAHlrW9bVS+aCKLu7CwgxI0alj6fRKWgVESe8cbEFmIvuQPsfkl8rjziGMjiv5 0gKRKsA/c+YqR8+MQkoC2LteG8V7OdJCBMvTaJrS4mF/Oxj663GUGcp5q4wop1XQtBso dm+Bg6GqrK/PSURTsl/pMmh47Pd5CZ5Stinr79j/bqEhH7pbxwwhXiOxdkvhKod6jtXJ 89+9G8Ezl5wpPV8CbTcCk3RspKp7WdZHwmdE8qEUyooWKy3eEx0zUYmSfmN2BqGWQvkT Ikzlq9yRusSwq4Yxjd6qjDDYXC5tUN0lUu9hx3+d2U3YySa9TO8Qd0kq4bO+Lc7PUhVv G8mw== X-Gm-Message-State: AKaTC03LSoJwyef6Wu87AVOJMSiCU4OjAuJBEGCO2lyeyVdFrr/Dwf4oL3LG1qqmkuxnrXJOhZB6V0bcLrqHIA== X-Received: by 10.159.48.146 with SMTP id j18mr1800026uab.6.1479900363951; Wed, 23 Nov 2016 03:26:03 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.121.199 with HTTP; Wed, 23 Nov 2016 03:25:43 -0800 (PST) In-Reply-To: <87d52a15-5fbf-a6fe-fea3-638c24186d99@mabe.berlin> References: <87d52a15-5fbf-a6fe-fea3-638c24186d99@mabe.berlin> Date: Wed, 23 Nov 2016 09:25:43 -0200 Message-ID: To: Marc Bennewitz Cc: PHP Internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Object type hint, now with added variance From: david.proweb@gmail.com (David Rodrigues) Marc Bennewitz wrote: > 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 I think that it is need too, because it will avoid reference the class by name when you need return it - but not is a biiig problem too. 2016-11-23 9:07 GMT-02:00 Marc Bennewitz : > > > 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 > -- David Rodrigues