Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112372 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 9431 invoked from network); 2 Dec 2020 14:31:02 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 2 Dec 2020 14:31:02 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7B0F0180532 for ; Wed, 2 Dec 2020 05:58:43 -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-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.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, 2 Dec 2020 05:58:43 -0800 (PST) Received: by mail-lf1-f43.google.com with SMTP id d8so4939374lfa.1 for ; Wed, 02 Dec 2020 05:58:43 -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=xMLk6GpPJg0G/jHyeSRlwuGAuJqXyW5Ww8sBeFv98Pc=; b=PBm1bjEW1sOb0MH24yyDkrOyROZxsKQDmCpRKpQt5/pKZh5C4LC9dHYhZAA41KXLkk oJVnV/Kg+dra2SfVrLM4uqAPXC9p1O5rsZpXIhJk6wtoUL228GOFkQsUGCUDtRIYZzgR Ug4sOsA74iC7MwFJH7SBSOL5edp0BlweJmGbo0GeHbSG2Eda1uvrL2UaoX9k5rshyYFS zwe+x0/ywNn4TW0jY+tpWuYbLPfyLzwykykutzUiYH41uU2bz0JKzRU3XSZwgnGlj/GO Rwcwua58i2QtPoC2qQ75bybzQmaemLkG4050vNtEC8eP3bBKcdNCFSlzHMEWWDztkfmY GJ6Q== 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=xMLk6GpPJg0G/jHyeSRlwuGAuJqXyW5Ww8sBeFv98Pc=; b=X92dit20s49eCTraXcm66JZQbZobrqIovHYFX0PZiOsEjISQBIfxk7Gtj12CDLzSxV EA+9HEU33XnIf96hQv5N7Vv1l+zN9g2UlGKhemng0CQB4w9O5Au1QeLC8SeDk2S867KB a4MCTJA4rZU+nPPPAKCXos01vSXQSTDnfJyTBpwdS9iYX+UD99r/4LLkrxuCvaMiCS9v ZQSLTJg0Kbz69XiUNLc+++PadZWzYS6XaJiMwCjS6c0R4fHB3kS9HMXB69kDtnSTLesu sxHWrEt4pXWvK7+bADNHlSoWdVDmsxVOKWQyxFgvjbkIdSbuyKbOlrsJuaNDERyW8XNU CEyQ== X-Gm-Message-State: AOAM532HJ4onkxgTPqly1+xJxoc0F+WQo7uMVfaN2Xr2m0Ee+wykEBH3 aLIOv2b0Q21OMTHMtkU5hl/RFR56LBAnuVqv+VE= X-Google-Smtp-Source: ABdhPJwNO/Yfeg+6EFa8MYZBxudr/AHQceRyzymrZMveCYzQuMbgWQYKl2KvkysdPTIaa1O30Zn8UDaCG9apX6MdNtA= X-Received: by 2002:a19:4bd2:: with SMTP id y201mr1292048lfa.330.1606917518498; Wed, 02 Dec 2020 05:58:38 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 2 Dec 2020 14:58:21 +0100 Message-ID: To: Benjamin Morel Cc: PHP Internals Content-Type: multipart/alternative; boundary="000000000000dfa24e05b57ba34d" Subject: Re: [PHP-DEV] erorr_reporting() and @ operator From: nikita.ppv@gmail.com (Nikita Popov) --000000000000dfa24e05b57ba34d Content-Type: text/plain; charset="UTF-8" On Wed, Dec 2, 2020 at 2:56 PM Benjamin Morel wrote: > Hi internals, > > Since PHP 8.0, `error_reporting()` started returning a non-zero value when > the @ silence operator is used. > > Demo: https://3v4l.org/CovYv > > Is this intentional? This breaks scripts that converted all errors to > exceptions, except those where the silence operator was used: > > set_error_handler(function ($severity, $message, $file, $line) { > if (error_reporting() === 0) { > return; > } > > throw new ErrorException($message, 0, $severity, $file, $line); > }); > > Thank you, > Benjamin > Search for "error_reporting()" on https://www.php.net/manual/en/migration80.incompatible.php, it discusses exactly this code ;) Regards, Nikita --000000000000dfa24e05b57ba34d--