Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113448 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 98303 invoked from network); 10 Mar 2021 19:29:50 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 Mar 2021 19:29:50 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 673F01804D3 for ; Wed, 10 Mar 2021 11:22:07 -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-vs1-f43.google.com (mail-vs1-f43.google.com [209.85.217.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 11:22:06 -0800 (PST) Received: by mail-vs1-f43.google.com with SMTP id j12so7087264vsm.2 for ; Wed, 10 Mar 2021 11:22:06 -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=Z3JwqkJ6cHaRGy78owXOqAKHD5eabCmNsMkmjHOTM98=; b=hg19ttPu4C3i5ObtufAUe9D4e7EYXVpmAaxKlEmLwLeABvQnTYjUZYIJSWEmKPjIeD kP6n+A0xaUh6Kt0+RwUrMMToOMHXEPxUEJ4q/OVufC1EV9eJM7yHgRTIb18ZCS8iHKtn rK/vjQiDKLGv5z5kSdSeOLoHTc5rrWebRMtCwGcoirK8FwlD7u3d4veY/yW/v5iUO7Jt 9mGaVxAPcdj2zUkIoCeETEfOXT8FtWR6XmiA2wcHmL355AvLu1dJOuWRXqMWho9z+IM5 j7yPVPUEjdLbNTbckYV+L5+E4QTczuBlZpHjUrzjAfBhjuSTx4ubuB/tqzClOKk2lrbz uSFQ== 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=Z3JwqkJ6cHaRGy78owXOqAKHD5eabCmNsMkmjHOTM98=; b=AoXxfQ10+cVoZSre7Ni/B/wa5/7R8QaaZR9MOGhN7rZRsFrp/7ZcUr0oIz5jMeVgDR lfwJvV5pt8A56XdJo3/l4jiVgcDjVVJo3/CUG5Gx5r81PTSNYuPjsXeDBYAf+UqwziJa xdjQDk4zYOVjExd+CNP7evkeiQtslciucAE17nOj4cWh7lOy9cl/38qX8d8FYPcBR7S1 Z+0++ZroX2yxs/+6NSPYaUKfzn1IfOUaC1cQ1j2Z4P9dz97OutPX95/FTN9Ai5lVyLA+ hYMykQ8mqzJuY5w6obBfrJP/h0jVrxCZ0g85yGNOOC9hmRH1lotqQ5PyM2AQUQ3gNwbF WUGg== X-Gm-Message-State: AOAM530NzKYoqZBlvCxLrxIKKbNUby4XNxDZwalXBhVaGllKJX6rVEPv vIs2AWoc5zRs3HFN64gFEqs9Y+pKzN3bsjgNFk7GLew0HYJ7QA== X-Google-Smtp-Source: ABdhPJwpCnOY6ONlkXgmKnQ7LR48/WcoX9ESc6X4TkgRrxrVN9VWSRa8uxm9Q6C8hjDC2BaJPbSMrfJPopv4AUfpX7Q= X-Received: by 2002:a67:7f42:: with SMTP id a63mr3038305vsd.43.1615404124608; Wed, 10 Mar 2021 11:22:04 -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 14:21:53 -0500 Message-ID: To: Rowan Tommins Cc: Internals Content-Type: multipart/alternative; boundary="000000000000041c9905bd339539" Subject: Re: [PHP-DEV] [RFC] noreturn type From: matthewmatthew@gmail.com (Matthew Brown) --000000000000041c9905bd339539 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 10 Mar 2021 at 13:55, Rowan Tommins wrote= : > I am however slightly confused by what exactly the implementation > checks, and when. Is it actually looking for "exit" and "throw" statement= s? > No. Any function annotated with `: noreturn` causes the engine to insert a ZEND_VERIFY_NORETURN_TYPE op at the end of the function's operands. If the Zend engine hits that operand =E2=80=94 which only happens if a thro= w/exit *hasn't* been encountered =E2=80=94 it emits a TypeError. 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. > If a significant number agree I can add a secondary vote on noreturn vs never, but never introduces more of a BC risk. Best wishes, Matt --000000000000041c9905bd339539--