Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108137 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 85944 invoked from network); 15 Jan 2020 09:02:49 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 15 Jan 2020 09:02:49 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 46B5A180505 for ; Tue, 14 Jan 2020 23:09:52 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 14 Jan 2020 23:09:51 -0800 (PST) Received: by mail-lf1-f48.google.com with SMTP id r14so11862593lfm.5 for ; Tue, 14 Jan 2020 23:09:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6o28BksWusrMr6edVPIV+t/1C7/yGsdbcc6m+GmaYnw=; b=f10Bq5TDuLpYk65CzxYgFucmsnAZ8MyCn5LSZRI0qv5hJQYXkRKSWFu4J1nqIu8iGX Gjk6qHzf/j2kTOx0F1/eldpWiL3ikjG5SR/ghKibNfxJKXpV0S+KdWP4hN+7SwTCdFlT XnZarwVzrFTPYp0OwTlMIqa9IrR+p/YGSDZhAVJyxXu9TlnW8ztCoN/IRAMD5aMo4Knc b0/ntVRibgQRIFBbzs7B7hqvjwpJsiAzRPL2e1VckFeMRftxp3cBY33D8ftn/1baS7HX p/7h2ZC/d4a4GyaKAq7sMnqO3pn6fFnDCmchY35r6tcNFHGiTa3iDbW7C/Z0Ma9bFjM4 xfIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6o28BksWusrMr6edVPIV+t/1C7/yGsdbcc6m+GmaYnw=; b=g/YRB+0w8HamsAUFWicNN6/ZOsAkh+3F40EZM7BN0XWHx/lM3FeZYGQydBDy+B0mQT C/vU8y+7rYsd634wlTc/hyFW7XFN47TVTMcvcdqb2HGl0QMwYV156f4WFIyVlm3iNIxK 92DIes9FSmAKY4Hl/KsBHicmrnbrL74wqFca5IYK8piJ3Z9c7eyqk6jxRUC1SmmZLdKZ Lb7IaoHZ/J/c61jzCGtMQoDkooyC6fgE0fzD/ZdjIWDbXwE6mmuxQexByrP/cOyn0WKD YI6XBUXcOsIpYbcoFCF4HnyqM2cfPa20/dx0H8rCiQjnIarRU/thaQvqZ3u/qgq3F9Dt xo/Q== X-Gm-Message-State: APjAAAVg/PW3fWdA7V7OsDzDBU22rHb8GW/MME760Zaohp7GUXbO2Ro5 T4GHeMm/CSdncPeXVL/keLfdQ/kFXne/EkuUBw== X-Google-Smtp-Source: APXvYqxo8QKhvGHQgwNKzeTJz7nTKHzsGE1ZQNNcpDnC73m7GHnDjawMZr7IL4P7GcTCJA++UohLa0p+4w3oVbqEJcQ= X-Received: by 2002:ac2:44a2:: with SMTP id c2mr3598917lfm.105.1579072188788; Tue, 14 Jan 2020 23:09:48 -0800 (PST) MIME-Version: 1.0 References: <5BAB2404-5491-41CC-9A66-6423D482BA3B@newclarity.net> In-Reply-To: <5BAB2404-5491-41CC-9A66-6423D482BA3B@newclarity.net> Date: Wed, 15 Jan 2020 08:09:37 +0100 Message-ID: To: Mike Schinkel Cc: Andreas Hennings , Nikita Popov , php internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC] Static return type From: guilliam.xavier@gmail.com (Guilliam Xavier) Hi, After reading all the thread: I'm +1 for `: static` as proposed by this RFC. I'm also +1 for `: $this`, preferably also in PHP 8.0, but that could be a separate RFC: - I like the idea to check it at compile time (like `: void`), i.e. that all the return points of the method be syntactically `return $this;` (maybe also allow `return $this->otherMethod(/*...*/);` where the forwarded method is itself declared `: $this`). - Regarding covariance, `$this` should probably be treated like a "subtype" of `static`. - I don't like the idea of making an implicit `return $this;` in addition to the check. I'm -1 for `: fluent` or `fluent function` as an alternative to `: $this`. I'm -0.5 for `: new` / `: clone`. About "what comes out is the same type as what goes in", I would wait for generics. -- Guilliam Xavier