Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85421 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54898 invoked from network); 23 Mar 2015 06:43:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Mar 2015 06:43:53 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.45 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.220.45 mail-pa0-f45.google.com Received: from [209.85.220.45] ([209.85.220.45:35868] helo=mail-pa0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3A/02-44294-926BF055 for ; Mon, 23 Mar 2015 01:43:53 -0500 Received: by padcy3 with SMTP id cy3so182001963pad.3 for ; Sun, 22 Mar 2015 23:43:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=6K2oxe4sruxgChdYfD5GzilUwNb2bHeQ8lwxlgwnURU=; b=NcfaYZDqxD1dvBbRLNUkmev6rJBYTJgxhHbWosbNBfZ331cvA5u9Qu9Df8sdtIZcgN fx6PyOp+or+GSjr40YmC15JFBPRK2/4tHw5vojWEbHRRmpzlxofB/f7B4Gnnhtrzy1zn l/3PN022aMtt1J6GPyJkJpr8GrkO/h17wlu8E8mjBJHKu5oeyfWgsJ9LK0XTEnFqQwJN JylJ3DMkcp/qfkHnX0Qqr5xrWMqzqUNWzutiYoGJqf+sCqRWn0/D9yBW3IMkJwxXPRmB +NFh4FQ8M6pudU5B6irwXn6R/agDIjpZhmlNVvlJrkLnEKZPBx83decxMHnQCuPBtqeW CMiQ== X-Received: by 10.70.90.81 with SMTP id bu17mr24319355pdb.105.1427093030050; Sun, 22 Mar 2015 23:43:50 -0700 (PDT) Received: from Stas-Air.local (108-66-6-48.lightspeed.sntcca.sbcglobal.net. [108.66.6.48]) by mx.google.com with ESMTPSA id f12sm15843911pat.43.2015.03.22.23.43.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Mar 2015 23:43:49 -0700 (PDT) Message-ID: <550FB623.8000209@gmail.com> Date: Sun, 22 Mar 2015 23:43:47 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Dennis Birkholz , internals@lists.php.net References: <550FA2ED.6080000@gmail.com> <550FB0E2.7020600@birkholz.biz> In-Reply-To: <550FB0E2.7020600@birkholz.biz> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Serializing exceptions From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > I think we should discuss if (un)serialization is a first-class > operation in the language and if so, we should try to make everything > serializable. Currently, we introduce more and more unserializable I don't think we can, not unless we can serialize PHP code (like Java can have JARs with bytecode). Otherwise, something like closure is inherently not serializable. Moreover, something resource-bound is not serializable either since it depends on something external. > If we don't want serialization as a first-class operation, we should I'm not sure what you mean by "first-class operation". We certainly want most objects be serializable, and they are. But some are not, and would never be. The question is - is Exception one of those? I think yes, but I'd like to hear if somebody says otherwise. > make objects not serializable by default unless they implement > serializable or __sleep()/__wakeup() and add an is_serializable() method > to check if an object is serializable. But currently serialization gets > more and more unreliable/prone to runtime errors. That's because implementers of classes are not careful to account for serialization. However, I don't think we need any drastic changes here. -- Stas Malyshev smalyshev@gmail.com