Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113453 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 7247 invoked from network); 10 Mar 2021 20:08:35 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 Mar 2021 20:08:35 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D3E261804E2 for ; Wed, 10 Mar 2021 12:00:54 -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-Virus: No X-Envelope-From: Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (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 12:00:54 -0800 (PST) Received: by mail-ej1-f43.google.com with SMTP id jt13so41285971ejb.0 for ; Wed, 10 Mar 2021 12:00:54 -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=vpszrLyqjm5W1njbUZ6AZ4sM+l6av028a7BAOVPO2eg=; b=SOQ53UjFuPzYmWrHn4Sh7y85f3I1+K2Mbgcnnx9MVozgk8BSTVzQLsFw+I5unsx3wg AGojNhQJh3J0sGPn1SU4N+OQLbK7Q4sKXBtSPLpUVnyeU7WPVj2nYkOTyQfr3X+jBJ9m u8P21NCl/UBqGopLLyvzun6GVH9YqblxwAp3/SzbBZ9E9pkkCM/IbotDakHd9dWibiJq DmwdM7WRwrlscliQylu0bmDkE4obv5a8Hqf+33PtyVEkL/wVfi6FKcDnjEHcM0efABey 5iEi6E1yR8LxjGrfsJT0A+kS53e3OKrh1S04OzqC7TirSV7Us/bGa+Q5MbS/BR/efoq4 gjvg== 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=vpszrLyqjm5W1njbUZ6AZ4sM+l6av028a7BAOVPO2eg=; b=faiwRzwaj4zQezsIlNizzljthYJH5W2mneYBXMYBDMf1bjVwu93H35e0fpK82mkwBN 7amlrXkFqCFmIwgtpwY2S+69n+DuLuL0tvHpBB6ZS6AW6zvfyojFTH6vduZp5972WAw0 uUlHTeS/gnPbe38yWck9fjblnjX5hzW2CnLnVgElOBHgibkrznPkb6xJLcql6YJNv4qk cKkJbAXoUrW74xZIMhe+aavuHJol4uZJWDRoeWVAsh60dbDzauYi+aecZVhzokvgI3US qTJXtczX7wxaeCm/XwwyO72rUBpCKDSmNaX/hXZEL5+NJcTpXxiJ0tPkIY6NLTKJ84KD di4g== X-Gm-Message-State: AOAM5312QtdpZglaDpIgBL+08HSPn+pjSLaNs10ZnNGMFQovVUyzB/V1 NL7KaUmOjncra7G26LWZFbB4B23+fMiSDF2jaDw= X-Google-Smtp-Source: ABdhPJyyBr9yzbXn36ZG3+P87Hc7g1a5bsHrsD+swb7a1m8IShPwu3lsRGzgMFKUoeGokodwcpZTFhJPyxTOW4qoQ5s= X-Received: by 2002:a17:906:3849:: with SMTP id w9mr124265ejc.7.1615406452947; Wed, 10 Mar 2021 12:00:52 -0800 (PST) MIME-Version: 1.0 References: <75a8a0ec-d988-7712-58b5-88c8061db605@gmail.com> In-Reply-To: <75a8a0ec-d988-7712-58b5-88c8061db605@gmail.com> Date: Wed, 10 Mar 2021 22:00:40 +0200 Message-ID: To: Rowan Tommins Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000cbbe9505bd341f4e" Subject: Re: [PHP-DEV] [RFC] noreturn type From: drealecs@gmail.com (=?UTF-8?Q?Alexandru_P=C4=83tr=C4=83nescu?=) --000000000000cbbe9505bd341f4e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Rowan, On Wed, Mar 10, 2021, 20:55 Rowan Tommins wrote: > On 10/03/2021 18:06, Matthew Brown wrote: > > Ond=C5=99ej 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. > 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. > I would mostly say that "void" consists of checking that no value is returned as plain `return;` statements are fine. While actually "noreturn" consists of checking that there is no return statement, implicit or explicit. As another distinction I noticed, for "void" the validation can be done completely at compile time but for "noreturn" both compile and run time are necessary right now. Hopefully, static analysis tools like psalm can further understand better and better the runtime execution paths and provide with errors. I was just reading the github committed RFC earlier this morning and I liked it. Regards, Alex --000000000000cbbe9505bd341f4e--