Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109534 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 80600 invoked from network); 5 Apr 2020 12:26:03 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Apr 2020 12:26:03 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 05BBB180088 for ; Sun, 5 Apr 2020 03:53:28 -0700 (PDT) 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-yb1-f171.google.com (mail-yb1-f171.google.com [209.85.219.171]) (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 ; Sun, 5 Apr 2020 03:53:27 -0700 (PDT) Received: by mail-yb1-f171.google.com with SMTP id i4so7088620ybl.3 for ; Sun, 05 Apr 2020 03:53:27 -0700 (PDT) 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:content-transfer-encoding; bh=FTxY5JhN9Oh0ZboOV5ZvvCsjFG5UWkjOj4SiTJS3GX8=; b=OYZr9nCSLEPOeopoQvfN8gjdiBwEI5dHlKkdl7s2oML6A9fujFLgM/7Iaffip4sSwg hJdAdoh/nre6A0JX7QiXNgD0j7QplJ3IeySVFuC/Y4684mkf8+Zu2XAFA7/3GhFmIEd9 isAOG1dCdLdVD2b5tR7Oev5lRZzrY48kQ3OUY1fRfbF2gidf8rmw1riJwxuYil/lmoce 4/W8DTcT+2wA3u8o9NG8vv5+v6aiIds4DBZZoqPsFDI9qtVl+p5jYAjiitYzw7Z49acx JT9Mt6NjZY72vcMA4rPyMG6uQl0iKKYCYiLGMQL0YQrcLM5jrr3S5WN6XzQv4bR8PyhK 9r5w== 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:content-transfer-encoding; bh=FTxY5JhN9Oh0ZboOV5ZvvCsjFG5UWkjOj4SiTJS3GX8=; b=Ki6oG7EAjhox+bxamYAQi1hWge8FEnqu0noKpHSbr5xBBagDxl8sqeVWzxa24EGt6i 7rXgc7cYJfAF3FnYZUlzbi+f37DRFVnchCUPVy+V/Ucp7/8DtBSAlnLPF8zc26pna38g tcPMxV0s+17UjVgC8P0v4fpZzG9G6bPmicGdYLsDxUi3dhF4j4NnN2/EBotNVfbA+82z yRToFzcgN+3Xuin6QP+h1N5+7wIjfDpGn3F/SAGdDaXYlK1okQCMSUz2JZceNfClU5oN 30ewcOAYcHhI4J+BCBkaUaCIuUJ268gVbM9dP8ck8mMMf72atBhWRCNRRZtYhaKI/GLb mMRg== X-Gm-Message-State: AGi0PuadqENYytMmZSkU9vbrKgUTeOJpQLhHGkPxxPIaVjsI5Jj5FjHi xi8KhY2xcA0xIHmDhdu4r5vZWmyeTnbdPPlLec6gOZt8 X-Google-Smtp-Source: APiQypKqZgpv3nZCzDyUGB747NwqmzPR8Gae460s+Kwx/MSx841Eo53hPpvLyRKpgBNL6YT+RlaVtpGUYRWRzNjJcow= X-Received: by 2002:a25:d411:: with SMTP id m17mr24415717ybf.2.1586084006983; Sun, 05 Apr 2020 03:53:26 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sun, 5 Apr 2020 12:53:15 +0200 Message-ID: To: Dan Ackroyd Cc: PHP internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [VOTE] throw expression From: tovilo.ilija@gmail.com (Ilija Tovilo) Hi Dan > Did the RFC get updated to address this? > > As the current behaviour listed* in the RFC seems wrong and surprising to= me. I did respond to that e-mail but probably got classified as spam as were the other e-mails I sent with that address. This was my response: > I've thought about this some more. There is a reasonable way to recognize= this, namely to check if the expression after the throw keyword is of type= ZEND_AST_OR or ZEND_AST_AND. The expression above will fail with this mess= age (given that $condition is false): > > > Fatal error: Uncaught Error: Can only throw objects in ... > > IMO this is clear enough that a message for this edge case is not necessa= ry. We could improve the error message by printing the type that got passed to throw: > Fatal error: Uncaught Error: Can only throw objects, bool given in ... Regards, Ilija