Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109023 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 67492 invoked from network); 14 Mar 2020 23:01:25 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 14 Mar 2020 23:01:25 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AE5991804DF for ; Sat, 14 Mar 2020 14:23:25 -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,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-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (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 ; Sat, 14 Mar 2020 14:23:25 -0700 (PDT) Received: by mail-ed1-f42.google.com with SMTP id d1so3771847edu.6 for ; Sat, 14 Mar 2020 14:23:25 -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; bh=gf4QLVGhtX8MFh5giQMi/k0qaoK2vjvCdOJjtaabDFA=; b=Mp2Cn9Qp6RYTEwG3YBjMVEWqfC8K5w7c2AYHfQDN3IdndkzGaCW1SgqxZrsuSnWknm 1CuE/F8lo/VW+SYgwpZqEb3sPlsJJ5sxZ0Iwe5k9+gP41C7YPcjbNvW2KlT73nZmSHwY WiCDdP6xonDIK0DH0/xBE+/SQjXotiIuf3I4Ucj70pQXycV/5sezcVx4xkP9IfLQu9nt p47QKVDwGXOSYfC8a5/p0de/2qZhzRsfRSEaXMGULrdfscNpyNZemPJrEc1PfFoZniWC i1NrEcluGMaOFJoiBA0n+OwBs3ZIHjhONaneaYmEDF+YhBRc7XIjr3mukMN/5/52mwSf xYiQ== 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=gf4QLVGhtX8MFh5giQMi/k0qaoK2vjvCdOJjtaabDFA=; b=twr1wTwq6EthZE2gwCsegkDa3YzH5HWsaiZD07Wf16br2gIFNlisNIhGPBAMz1HEA0 OH2h37f0UMzb+vAd6Np4sY1kJWNLktnxWVSnvErg73a6QemsPUfFYlpwUfkUGp2Xi9qR BitHwFUCFVYK7x8+etGKbK5RAv71uEad3v/ot01BfRYd6gi08BQzF9aEGBLyRNE0Xu+k xpTmpFNjmUIKGkLnz0bgPpNXqeQaRR0kyuO8etdq15tWEP4wNO4WvA0Blt3O2G5N9+q6 jxPV1+fk0i9LFjLjjNq1/X0iNamYVRGAcAwSjKtayYifTmycpC84+buJScHkp5OCdLeG +luA== X-Gm-Message-State: ANhLgQ0rajmMZyI3IUMOJgPl0Go0poHRchcLuIPwTzGSwkwq75CDdm6n wF8Vhz06AL5YcuFdnGpXlUnXadmVDdp08SRoqqxS9/F9jic= X-Google-Smtp-Source: ADFU+vvsHUbLwJHa00JYPuRiZ3Aym+a9THARq50hDZcYXmg2nVhD6Z1lz0ZhwoRfqvcJgSu4ZHd/6cJbbqGwdqj/y98= X-Received: by 2002:a50:9f4b:: with SMTP id b69mr19834986edf.250.1584221003391; Sat, 14 Mar 2020 14:23:23 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sat, 14 Mar 2020 22:23:11 +0100 Message-ID: To: Mark Randall Cc: PHP internals Content-Type: multipart/alternative; boundary="00000000000027261305a0d7320f" Subject: Re: [PHP-DEV] [Discussion] Promoting declare failure notices to exceptions? From: george.banyard@gmail.com ("G. P. B.") --00000000000027261305a0d7320f Content-Type: text/plain; charset="UTF-8" On Sat, 14 Mar 2020 at 21:19, Mark Randall wrote: > Greetings, > > I have created a PR that will throw exceptions when using define() > with invalid types or when trying to redefine. > > Trying to redefine a constant or define a bad constant would throw a > ValueError on the name parameter, trying to pass an unsupported type > would give a TypeError on the value parameter. > > Normal promotions are fairly run of the mill, however for some utterly > bizarre reason the existing behaviour is to print a notice and not a > warning as with almost all other functions that are failing. > > Is there a good reason not to promote these to exceptions? > > https://github.com/php/php-src/pull/5265 > > -- > Mark Randall > marandall@php.net > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php I'm all for it, I wouldn't a lot of code to be affected by it as that code would be truly broken. Best regards George P. Banyard --00000000000027261305a0d7320f--