Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87339 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98900 invoked from network); 28 Jul 2015 13:07:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Jul 2015 13:07:58 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.175 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.212.175 mail-wi0-f175.google.com Received: from [209.85.212.175] ([209.85.212.175:33457] helo=mail-wi0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 04/90-25211-CAE77B55 for ; Tue, 28 Jul 2015 09:07:57 -0400 Received: by wicmv11 with SMTP id mv11so178815868wic.0 for ; Tue, 28 Jul 2015 06:07:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=EUBTV21UGC8ewbMTin8sczi1U7SFAF/g0prEZvT0Dmc=; b=UdkRGjxOald3hAzBpFZIo5hAflMhRmlXFzNRNwxBmNUgVRx35aQ+MQ8Y2K7YafUWC0 skTP70NN2jtovnsJB5O0scus7CVhlIodpN/ftRFV/syVYzrLv8bh2k/Wll4LDX4AW5p/ E/rZdKwqW6Fg8Z+1Vi8mcxxF6esbYnM0HD48X1MWwsk5qyhh0y3kbjDO8+f9DsglRZAA W2td6St7BDOyWzwvitnf/R/liLOiFnowsNrrgOZd0NSusFOTTrnTJge4EW63umQHRBIK KN9GQxC0wKsS/5ROXWqe151VdKqOyMXXcO3mNFAxFjN6ZB25xrqOLwNewcuq0jpgGIBN V2QQ== MIME-Version: 1.0 X-Received: by 10.180.76.132 with SMTP id k4mr17162311wiw.87.1438088874183; Tue, 28 Jul 2015 06:07:54 -0700 (PDT) Received: by 10.27.3.85 with HTTP; Tue, 28 Jul 2015 06:07:54 -0700 (PDT) In-Reply-To: References: <550FA2ED.6080000@gmail.com> Date: Tue, 28 Jul 2015 15:07:54 +0200 Message-ID: To: Stas Malyshev Cc: PHP Internals Content-Type: multipart/alternative; boundary=f46d0435c0228051dd051bef2825 Subject: Re: [PHP-DEV] Re: Serializing exceptions From: nikita.ppv@gmail.com (Nikita Popov) --f46d0435c0228051dd051bef2825 Content-Type: text/plain; charset=UTF-8 On Mon, Jul 27, 2015 at 9:08 AM, Stas Malyshev wrote: > Hi! > > Looking into some issue, I've discovered that, to my surprise, > > Exceptions are serializable. Except that it doesn't always work of > > course (e.g. see http://stackoverflow.com/q/9747813/214196) because > > exceptions contain backtraces, and those can contain non-serializable > > objects. So in reality, you never know if you can serialize it or not. > > > > So, I wonder - would it be ok to make exceptions not serializable at > > all? I think that would prevent major WTF factor when people try it and > > it randomly fails. > > > > Since discussion on this did not lead to a definite conclusion, but I did > not hear from anybody that they need serialized exceptions, and we keep > getting bug reports about exception serialization and various issues > triggered by it, I propose this change: > https://github.com/php/php-src/pull/1442 > > Since it is kind of BC break (even though I assume it breaks something that > needed not to be allowed in the first place) I'd like to merge it in 7.0.0. > Please object if you think this should not be done and explain why. > Otherwise I intend to merge it after a suitable wait and after adding > necessary tests/docs. > -1 on this. If there is no technical problem with serializing the Exception class itself, it should be possible to serialize it. It can always happen that an object contains some not-serializable member, this is nothing specific to exceptions. I don't see the point of this change. Also, Christian Stoller's mail pointed out that Symfony uses serialized exceptions. Nikita --f46d0435c0228051dd051bef2825--