Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110319 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 94366 invoked from network); 31 May 2020 15:06:15 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 31 May 2020 15:06:15 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2949D1804CB for ; Sun, 31 May 2020 06:47:42 -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-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (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, 31 May 2020 06:47:39 -0700 (PDT) Received: by mail-lj1-f169.google.com with SMTP id z6so4797967ljm.13 for ; Sun, 31 May 2020 06:47:39 -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=sFzL5vuh/fg4HGS7Nl/JMnCZkA7xb43bwRGz0Vj9de4=; b=TEeHnOI6oltVtIT7+/3TwKngWuBZOZRHf8iIrY2cErlR7bfZSrpQsWqUJMgxoDuPts HXmp3KrldGOs97lIwGWQs4LbEOPyiq5fokgQAUfmK6HP1XKjmavEVmS26wre3uTBUrUl YSeGvwywCCydHAijdtcV872G8bfs16Vnod9XVH5M9jm1tdaZdrxTx6Z1GVU/J1jZ3KPp kLpAJVUllo81x3+bQNIXCtcKuJN2DJGzYiNrhsM+gob4yq2K+52Dja57fqxpE4lMSF58 9QTy8Oze2Gu7bToSi5l8EVb5ZAf2vS5VWHx2bjIrR8+THKnZj/+tdnb/bQKkOQopJuwz p7mw== 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=sFzL5vuh/fg4HGS7Nl/JMnCZkA7xb43bwRGz0Vj9de4=; b=aiWYLOjw3gKckB0XU6EU8pawh+CKQKppj0+SEoEiLx2so6eqD+5Zg6yohz64Lo3/R5 jGlRmURrCGZgqmZZFmg0sgx9ybXj+2MvdZTW6q+rZQPTEDBgXgqgi9DZb5ipIu1CgY+t ulkl1smKNnZ3b5XLNBhAxqpOOqBaY4XiYytRnvhBs56Qg5t2bJxGTnF3qb9QtdcCZ2lw eNAmQ+jownZ7j54f0wFS22S7O1WfMyZ7JzMTE0VksVvj45o99hjMYwixKtk5wBEilLeY K2uYKURSt7sg0iyMrNJQiFXo2mLbi6yx1APM4dDPlQDbda8MfnhTlgvYr/rp2UAKn+5f p6dQ== X-Gm-Message-State: AOAM531uDMn+ad2wn4sAk4JYOTPWQvs1sD7D3I8wI0HLx41jjn0pCiuR /NzhauRz66qQp49Wr8We1KUpf62OYoTETyfmcZg= X-Google-Smtp-Source: ABdhPJyMWMbTZxKRIJd6VctE9A+TI7bUXjaNXV6fttIRx9zX1Z7bK4ylLPSsz8nsCOnoWc+Fsa2IxEWAMsob1lLTYTU= X-Received: by 2002:a2e:6a03:: with SMTP id f3mr4292072ljc.135.1590932854698; Sun, 31 May 2020 06:47:34 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sun, 31 May 2020 15:47:18 +0200 Message-ID: To: Max Semenik Cc: Internals Content-Type: multipart/alternative; boundary="000000000000aa7d6705a6f1ebf7" Subject: Re: [PHP-DEV] RFC: Error backtraces From: nikita.ppv@gmail.com (Nikita Popov) --000000000000aa7d6705a6f1ebf7 Content-Type: text/plain; charset="UTF-8" On Fri, May 29, 2020 at 8:24 PM Max Semenik wrote: > Hi, I'd like to present a new RFC for your consideration: > https://wiki.php.net/rfc/error_backtraces > > In a nutshell, I'm proposing to give errors equal rights with exceptions > and provide backtraces for them, too. > I'm concerned about the performance implications of this change. Backtrace gathering is quite expensive and doing this for every diagnostic will have a large performance impact if there are many of them. This is okay if your code is intended to be diagnostics clean, but unfortunately this is not a given. If you generate 10k deprecation warnings during a request, you're definitely going to feel those backtraces. It is already possible to get a backtrace for all non-fatal diagnostics through a custom error handler, which allows you to control whether you want to collect a backtrace for a particular error. As such, I would recommend to limit this functionality to fatal errors only, where such a possibility does not currently exist. Additionally fatal errors also naturally limit the performance impact, because there can (approximately) be only one fatal error per request. Nikita --000000000000aa7d6705a6f1ebf7--