Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85417 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46110 invoked from network); 23 Mar 2015 05:31:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Mar 2015 05:31:40 -0000 Authentication-Results: pb1.pair.com header.from=jrbasso@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=jrbasso@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.169 as permitted sender) X-PHP-List-Original-Sender: jrbasso@gmail.com X-Host-Fingerprint: 209.85.213.169 mail-ig0-f169.google.com Received: from [209.85.213.169] ([209.85.213.169:37745] helo=mail-ig0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9B/50-44294-935AF055 for ; Mon, 23 Mar 2015 00:31:38 -0500 Received: by igcqo1 with SMTP id qo1so30000750igc.0 for ; Sun, 22 Mar 2015 22:31:34 -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=YGN83069IDHGb7ae7fPSezsevGH6+gidmKxigpaQbyo=; b=HuJqzgNvh+3FfesMYUH6l4lvVvKKzFAc6cN/8+xLtas4RLAeKg4jd2CpRatFEW0aCz e5Q/Uh3z79dpn4fq/+2RdAoIVhChqWnig1ANFJjxlWIsz1j/eTCWMKHLdPZtNrABYnMk KkRXZN4qurksbwrpwLmHAiaIV2RjkdwS7ARzERpvpRz+otv+mY3kXZNhUdL9IneeHx10 K8MSMwCn5ZZcXuO/7jexv9C8dcwx5UQvQiwXXH6ZzR1Spr60emeSSD7GoSlqKNv6ghM1 0NmJeAxfPMphas635wB8QCdVnjtqLmpLlIrJU+op0tO52a7TXJ9X5GQSLOiKKIpJJIjI +W2w== MIME-Version: 1.0 X-Received: by 10.43.13.71 with SMTP id pl7mr17871497icb.31.1427088694430; Sun, 22 Mar 2015 22:31:34 -0700 (PDT) Received: by 10.64.148.6 with HTTP; Sun, 22 Mar 2015 22:31:34 -0700 (PDT) Received: by 10.64.148.6 with HTTP; Sun, 22 Mar 2015 22:31:34 -0700 (PDT) In-Reply-To: <550FA2ED.6080000@gmail.com> References: <550FA2ED.6080000@gmail.com> Date: Mon, 23 Mar 2015 01:31:34 -0400 Message-ID: To: Stanislav Malyshev Cc: PHP Internals Content-Type: multipart/alternative; boundary=bcaec511e116b1d32e0511edfa7d Subject: Re: [PHP-DEV] Serializing exceptions From: jrbasso@gmail.com (Juan Basso) --bcaec511e116b1d32e0511edfa7d Content-Type: text/plain; charset=UTF-8 Maybe you can implement the __sleep method and just return the documented attributes (message, code, file, line). Not perfect, but probably more useful than throw an exception, specially if the exception is something that is the attribute of some object that is being serialized. Juan Basso On Mar 23, 2015 1:22 AM, "Stanislav 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. > > Thoughts? > -- > Stas Malyshev > smalyshev@gmail.com > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --bcaec511e116b1d32e0511edfa7d--