Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108030 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 22180 invoked from network); 8 Jan 2020 13:52:24 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 8 Jan 2020 13:52:24 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C73F81804F4 for ; Wed, 8 Jan 2020 03:57:47 -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,HTML_MESSAGE, 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-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) (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 ; Wed, 8 Jan 2020 03:57:47 -0800 (PST) Received: by mail-io1-f45.google.com with SMTP id n11so2860224iom.9 for ; Wed, 08 Jan 2020 03:57:47 -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; bh=KHiJQk2nUEg4/ldpn8vsntQX4ghIPk8hhOpB2t82qGc=; b=ZwFtnE0eNHzRiWi9USS3y4GyHN11E7PNVS9IYPdVdahmctAymEhYUpgJocPBWtef82 8PVRy7rQqJLM/8RIyeCTQvAkORF6yCL2J/P7wBPo76GnofmSv3Tqy6NbuEj4480mrIgh +ChMRvJIQiOAOFkBOyOCXIv9x/qmR6m1UIO9DfLrd8tFuDVXyYi50DqzyfQ6GP1sorjL w7fFU93a1U4XjTmwoj3lbwYpNUJrHQyVkSrD2EqrJrn1OVivoNYy4nubr9GwjeJqO5st t4CYgXxpxa5S9x0gadiCjjRdvtwbYiKBMaTaL9J4PMEQRumxyoBqGjykMMDtfL8n68yk tBzw== 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; bh=KHiJQk2nUEg4/ldpn8vsntQX4ghIPk8hhOpB2t82qGc=; b=lA7xZxjJdjJN0ia/3sxaLLgO9nl/iV0l3DUII4C/7nFmZsOKd0KxiflY5m+etQ3emq qvgJgHvg3HGwwxZptdLRt2s8xhgM65qSs1FBuz87cNWBxf9u0noxMg63hsCKLTIvVJcX Td2koCsla1oll94cCndNJZZ1M6LAYqti4GkzkTQJx3IJ05F2S0yIqZ8QB2e51n7mLZIw rjVQAoPADdyC7rQPVfo9Ke7gFVKaW/11vRJwwGKea0gEEAZEGkOXvgoYJQ6S1iYe2fnT 690ZByGwUNIlhs4nq34KUQBUYebqQ7fd+KTPU2VWXZkMBp+erTBPocOfNdpgeOROwBrO lUmQ== X-Gm-Message-State: APjAAAX+Orc1bNKdI2p37Y6TIPt+CbFIybqNAXl4AyG00yqHOe2EcMyx /CiX1cVJrVxnEYRrVAn9tjsw50Oq6SaVhMFeDlAbig== X-Google-Smtp-Source: APXvYqynlPnYg5VHIZrTgR+tE3aeqS3WvWJaqOVhGQEkFzIzQ0GazmaViGiXoVPYOTCS3T4s2KUOJ0vRHXQm9NCQWmY= X-Received: by 2002:a5e:8612:: with SMTP id z18mr3082513ioj.206.1578484662796; Wed, 08 Jan 2020 03:57:42 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 8 Jan 2020 11:57:31 +0000 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="0000000000009c08f7059b9f99d9" Subject: Re: [PHP-DEV] [RFC] Static return type From: rowan.collins@gmail.com (Rowan Tommins) --0000000000009c08f7059b9f99d9 Content-Type: text/plain; charset="UTF-8" On Wed, 8 Jan 2020 at 11:42, Nikita Popov wrote: > I would like to propose the following RFC, which allows using "static" as a > return type: > > https://wiki.php.net/rfc/static_return_type > > While I'm personally not a fan of late static binding, we do support it and > people do use it quite heavily, so I think we should also support it in > return types. > A big +1 from me; I'd probably have assumed it would work and be disappointed when it didn't. I can see why late static binding isn't to everyone's taste as a concept, but it is very useful to emulate other features like named constructors, as you show in the RFC. The fluent interface example is interesting, because it doesn't actually involve late static binding at all, we just need some way to say "what comes out is the same type as what goes in". Regards, -- Rowan Tommins [IMSoP] --0000000000009c08f7059b9f99d9--