Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81948 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36345 invoked from network); 5 Feb 2015 17:30:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Feb 2015 17:30:26 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.180 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.192.180 mail-pd0-f180.google.com Received: from [209.85.192.180] ([209.85.192.180:35064] helo=mail-pd0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E6/85-27691-1B8A3D45 for ; Thu, 05 Feb 2015 12:30:26 -0500 Received: by pdbfp1 with SMTP id fp1so8975825pdb.2 for ; Thu, 05 Feb 2015 09:30:22 -0800 (PST) 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=CYLxLFRwY5jzlYf2cUIRpNoHMv3CPXGvsiqkN0gpTc4=; b=oR6Rj/OMUbxkxHGQ1j0gvDREs1ryzajWMVkS0MKZRmOS/PMwKUojabPQNdaUe95jl9 7ZFehpOycC3I+VsjJM/W/IfcfwHRPfCQZKgo6Kcrc73855bsleG8vOzi6C56RIW7y53W hzvniO2CsIIvRfNjN+SvREDudn+VB9iWSDfsEVnaCWmGCgfsZgJPVqdx9pczUdSt8lPm N9STT14BDZa1jQrkyX9sNDvt9S4NaxSJUqYJCP7MB+vvNcucRSjIsi3gUfkYBNXODMrX F0JrRvyXNTw0NG/gcmCSM8r4cdcYFZGaStxGClC8lQB+s98BvHiUYHTdITtSH/PMkX+/ Ooqg== X-Received: by 10.68.141.204 with SMTP id rq12mr7282209pbb.7.1423157422771; Thu, 05 Feb 2015 09:30:22 -0800 (PST) Received: from Stas-Air.local (108-66-6-48.lightspeed.sntcca.sbcglobal.net. [108.66.6.48]) by mx.google.com with ESMTPSA id qy3sm5662714pbc.4.2015.02.05.09.30.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Feb 2015 09:30:22 -0800 (PST) Message-ID: <54D3A8A1.70700@gmail.com> Date: Thu, 05 Feb 2015 09:30:09 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Juan Basso , PHP Internals References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: Serialize generating corrupted data From: smalyshev@gmail.com (Stanislav Malyshev) Hi! >> I can try to make a patch to solve it, but before that I would like how >> the behavior should be. Some options: >> 1) Give the notice saying the field doesn't exist and do not include on >> the serialized response >> 2) Give the notice saying the field doesn't exist and convert the value to >> string (ie, on my example the int(1) would be transformed to string(1)) I'd try (2) if it doesn't work (which probably would be the case unless your object happens to have property named "42" somehow) then produce a notice and omit it. If __sleep returns wrong value completely - e.g. false, I'd produce a warning and serialize it as null. -- Stas Malyshev smalyshev@gmail.com