Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110254 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 36380 invoked from network); 22 May 2020 17:29:56 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 May 2020 17:29:56 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 81E2D1804DD for ; Fri, 22 May 2020 09:09:06 -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=0.6 required=5.0 tests=BAYES_50,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-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) (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 ; Fri, 22 May 2020 09:09:02 -0700 (PDT) Received: by mail-ej1-f48.google.com with SMTP id d7so13635040eja.7 for ; Fri, 22 May 2020 09:09:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=FBLcd5caxhwksYe4/tErZoe5hZfualPErsItO2hQ2So=; b=Y1OM2YgnUHz36xNSa2IheG6MFbMYTwfT4CUzLkMB/SpggjRk3LhucsHCt3hCa8l9ep rIW66dcNQvf8OtxXcQQwmk2ILdU+8GVyzfvQlpYmVnFWw1Y0ygmelgq9k52LTHzNi8NX aBLrqZcJWgqaRnz9Q9Y8a/jPB7jeCEVYgNszKk6IbIJ+wOS2zr0haiepn3P2rTH5BR2Z FTTwcyvvC5nP+ZDWyFd+0aV/0OPVzJhDB2/9rOl8hE4pDBqsF/QCW3ArTvEkJCgI524y 6Z/ZPbMKh/eL/doX3qxqdLnroioVf5fUCwolLOeP1+g+ldPIYBeQbQFWGLE9oUg2m5nA hX4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=FBLcd5caxhwksYe4/tErZoe5hZfualPErsItO2hQ2So=; b=Maxy8i4P25GnrFlXiAWylB/Oez7GjvxYjKT+cPHCDs7XrY5PKiURGE6gtB7pHDfNvO ROMAbXvSh9SruSJzfmn73CS8ZoXQt143cVUZMqUYYpJrmklmM9m5O8EmXXwINCPz84aN S66uyNM39uI6ipsK1U02ZHELX+DgKnALakfwJ3ilEGEKdfhHzwTwlnUFXghvE6FraK/5 YscTYW+TrygGDx0n9mEB8MHtQLtUWB8o5+p9tCCNZVk2TONXDco3P5oCT+nYDm5HU/tI 2VMV1T8suwWE6Z8wagQLNlH2EA21g6hcezXauxwv8Y/0fBfL7Hfdn7NjjPJbghCkiEXU 598w== X-Gm-Message-State: AOAM532ubhsAQyIFM940ue3Et2+UMj9LScIJa0jkzzoRyYVf+nt8wGzb 4n8A4zopWoX+JE6P4geM5abeO2oKpn49OP1Jk8mwCfGsGQ== X-Google-Smtp-Source: ABdhPJyBvO3zm5Z/SKUqAyz6y9Eb37q+k4As9GR81IyLsbgGmZsjjVuOvym2KJEBRh7qKqxcnppo085GpgstR9xmzuA= X-Received: by 2002:a17:906:bcf8:: with SMTP id op24mr8706789ejb.260.1590163739294; Fri, 22 May 2020 09:08:59 -0700 (PDT) MIME-Version: 1.0 Date: Fri, 22 May 2020 12:08:48 -0400 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="000000000000d0c01305a63ed8d4" Subject: [RFC][DISCUSSION] Error Exceptions mode From: iggyvolz@gmail.com (Katie Volz) --000000000000d0c01305a63ed8d4 Content-Type: text/plain; charset="UTF-8" Hello internals, I want to start a discussion on an RFC to add a declare() statement to convert all errors triggered within a file to exceptions. Currently, the only way to handle notices/warnings in an exception-like manner is via set_error_handler, (for example, example #1 on https://www.php.net/errorexception) - however this has several disadvantages (in particular, it cannot be safely used in libraries without affecting other libraries). The declare() would only affect code on the particular PHP file for which the declare was set to 1, in the same way that strict_types only affects code on a particular PHP file. I have listed error_exception, error_exceptions, and strict_errors as potential names for the declare(), although I don't feel that any of them clearly and succinctly describe what is happening here (if anyone has a better name I'm certainly interested). As I do not have wiki karma, I have posted a draft RFC here: https://github.com/iggyvolz/php-rfcs/blob/master/error-exceptions.txt. A partially complete patch is linked at the bottom of the draft (very much based off the strict_types patch). Thanks, Katie Volz --000000000000d0c01305a63ed8d4--