Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100193 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61066 invoked from network); 12 Aug 2017 14:37:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Aug 2017 14:37:15 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.177 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.128.177 mail-wr0-f177.google.com Received: from [209.85.128.177] ([209.85.128.177:34722] helo=mail-wr0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 01/2C-34801-A921F895 for ; Sat, 12 Aug 2017 10:37:14 -0400 Received: by mail-wr0-f177.google.com with SMTP id g28so2889916wrg.1 for ; Sat, 12 Aug 2017 07:37:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=B0AzWJfeEwWiXc/E1K0OItgOdefcvhgypcyvVv+MXs8=; b=dAHMkVoA0nsJpvhR8PHIZv4NHMlb9Z0puwt3tJqTDHmEUFHMOF0qyJqDy9EmBsfSxF KhiogPdgrCP3/amYtZzM5kDu69YmKHgq0rxjdxmekrAe/kmE8zOoNVEL9N2wNbS3T/K4 +mSsp7g9sAfDTmcjuuXU+LtFGfZ1MSoYtXWXQ8IJONIaxXYhqTAMVITES2GEa/58vaH2 GdTvlqRRrVF6ZjLG2GiDVe2IzJec7hqFIo7o6EayrDZC7B5FfL8T7Uya4l4E+YARJ6I5 xUTxvIZukzAg3z0DlvNSWVnfOAYAWT8PpnS7kb3wqZGL/2SWhRm6s2z4tcLS8JKwK/LF 8rlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=B0AzWJfeEwWiXc/E1K0OItgOdefcvhgypcyvVv+MXs8=; b=c8qJl5KS8SnlF1vqBjB3ow9hCYCqrx5UD4HoDNTqzrrrlVodSPbtS9BHiaiNqtz/zn /kwLm2xzWPgob5WMwmet7frZsYF/86aGTnhf3tXMYuDEf3ZRiBzA0DUT1SVqFvGk77Xj STRR+Cl0U+M33IX5FYqb9pLoAn4TEzHbRfja3xR0uJV97uOQRzpVoeuqzzTWK+LHIX1T nW+6PUB/uBhvCIWgkDMNI1FKSbmfUx/MAKgnv1Dwa7JQ24GJk/erkYqVGo89QV0RywaK 5RhPxMEy/lNZnumxDMHBU359VviPU1veAlAQb5EuhVSiWQMEdzZcBCTtlDUNRlFGaa2L ngEw== X-Gm-Message-State: AHYfb5hr4nerZijNScupb9e8UKQVev9x3bmxxYXAubzziFFbwItd0DnC Ow9AJVEKg2TTPYLR X-Received: by 10.223.166.230 with SMTP id t93mr12977367wrc.39.1502548630683; Sat, 12 Aug 2017 07:37:10 -0700 (PDT) Received: from ?IPv6:2a00:23c4:4bd2:6e00:7d44:ec2b:7343:849? ([2a00:23c4:4bd2:6e00:7d44:ec2b:7343:849]) by smtp.googlemail.com with ESMTPSA id p4sm2408652wrd.50.2017.08.12.07.37.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 12 Aug 2017 07:37:09 -0700 (PDT) To: PHP Internals References: <7e336645-7b47-2772-257a-a51b6849e4b5@gmail.com> Message-ID: Date: Sat, 12 Aug 2017 15:37:08 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <7e336645-7b47-2772-257a-a51b6849e4b5@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Stop Exceptions capturing object references for trace arguments From: rowan.collins@gmail.com (Rowan Collins) On 12/08/2017 04:25, Stanislav Malyshev wrote: > Hi! > >> The "args" part of this contains full object references to anything that >> happens to have been a function argument in the stack, and causes two >> problems: > I think it makes sense to make exception not to collect args. In fact, I > think this may also be one of rare cases where new ini setting would be > appropriate, where the default could be the old way (at least for now, > for BC), and recommended production setting would be off. > My only concern is if anyone is using this data for anything other than debugging - e.g. if they were somehow extracting extra context about the exception by traversing the backtrace to a particular point and grabbing the arguments. That feels like a horrible hack to me, but that doesn't mean someone isn't relying on it. An interesting side effect of an ini setting, though, is that it could in turn be made to raise deprecation warnings at some point, whereas just accessing the 'args' element of an array is pretty hard to detect. So for instance, we could theoretically have: 7.3, add ini setting defaulting to on; 7.4, change default to off and raise deprecation notice if it's turned on; 8.0, remove feature, error if ini setting is not set to on (ignore if set to off for smoother upgrades). Regards, -- Rowan Collins [IMSoP]