Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113446 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 94745 invoked from network); 10 Mar 2021 19:02:58 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 Mar 2021 19:02:58 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3644C1804F6 for ; Wed, 10 Mar 2021 10:55:17 -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,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (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, 10 Mar 2021 10:55:16 -0800 (PST) Received: by mail-wr1-f51.google.com with SMTP id u14so24521911wri.3 for ; Wed, 10 Mar 2021 10:55:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=LCdagTjhZz+sWujo2pF32jv1mbI25nH9JzSbzja9J0w=; b=DzbSPp14vWij4sX25W6f/KY2RfwB4Bfox3Ir2B7GtTr30PD7LC8aB+zvrY5++To0h7 Tr+d4a6RYGOQzMntuGNfrMrSO0fRCjjGleTzPoXmIsau0SJunTqiTq9RWQ0EPjgrkXsB 9ptFIhB1zZcvF5uhqh+NIQGYxOl7Mns7bve9N4+ZHhiuj/iIemN6QmszCC196MQKBOhW FWlyxkwJtqwLns5BQdI2ujfg+d2DEGncXrqPCgkR+5DzIzqaI+dz9xpMT53nQWvoB/yL Fi6Vkyy77EcbASdw3v+4hr/mANszNO0NFEkZTCvNk1rZOnHCkAsfcUg4s1Izd8P6ID4P /Csw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=LCdagTjhZz+sWujo2pF32jv1mbI25nH9JzSbzja9J0w=; b=lBiDNHOwa7CLWEK9DaZqQLFpPMr/ET61N5Hdvk59O6G2ptAVOMdNJ0m158q9uUmbky CrItOruc1bFu5mMNsgT6WxsskMTEtmjhiv4JFlVz3RMNE/lTq0DVyiHbY2KQuK8lARSn s+ZH9+rJuFTT5EXrYuhl65QmPsoCSx8zwyVR9AifncyL+kSdK16mniY4Dgfffg7995Eo ttDvc/+4qbS7I8q6jQekrAvr68CpQWUtZu/NQct4rME84dJO7EBCnlVd0SNl3v9/IRNH Z5vEsMs4eviHSK8v0V7LqC25erz42367AIjO+sL+IjnNs2WtONDk+ilimf5lQg45iJiv Vh4g== X-Gm-Message-State: AOAM532+O3+CJXl0QdDMcUDfr7VG71MBDb7GtkpWXfhNgs7UX50wQsC+ TP66RgRiySIMqnOXHz6nCZI6iJ2NP9U= X-Google-Smtp-Source: ABdhPJzIz5w0iW+f4aPBeUMzBkfLxefGgvfadvNIRDfo7Ba8moqQb9uLzoP4O2OP7q8YorpnYeorPw== X-Received: by 2002:adf:e38a:: with SMTP id e10mr5009158wrm.37.1615402515168; Wed, 10 Mar 2021 10:55:15 -0800 (PST) Received: from [192.168.0.22] (cpc104104-brig22-2-0-cust548.3-3.cable.virginm.net. [82.10.58.37]) by smtp.googlemail.com with ESMTPSA id w11sm210002wrv.88.2021.03.10.10.55.14 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Mar 2021 10:55:14 -0800 (PST) To: internals@lists.php.net References: Message-ID: <75a8a0ec-d988-7712-58b5-88c8061db605@gmail.com> Date: Wed, 10 Mar 2021 18:55:14 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB Subject: Re: [PHP-DEV] [RFC] noreturn type From: rowan.collins@gmail.com (Rowan Tommins) On 10/03/2021 18:06, Matthew Brown wrote: > Ondřej Mirtes and I present an RFC for the noreturn type: > https://wiki.php.net/rfc/noreturn_type Thanks for the proposal, I can certainly think of uses for it. I am however slightly confused by what exactly the implementation checks, and when. Is it actually looking for "exit" and "throw" statements? The text talks about exiting "explicitly or implicitly", but doesn't give any examples of how this works. For instance, is this code valid, and how does PHP know that it's valid? function my_exit(string $reason): noreturn {     exit("$reason\n"); } function canned_exit(): noreturn {    my_exit("The normal reason"); } The other thing I'd like to mention is that PHP's implementation of "void" consists mostly of checking that there is no return statement, so a separate keyword of "noreturn" may well cause confusion. I would personally prefer the name "never" for this reason. Regards, -- Rowan Tommins [IMSoP]