Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81676 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5827 invoked from network); 3 Feb 2015 01:57:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Feb 2015 01:57:32 -0000 Authentication-Results: pb1.pair.com smtp.mail=jrbasso@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=jrbasso@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.177 as permitted sender) X-PHP-List-Original-Sender: jrbasso@gmail.com X-Host-Fingerprint: 209.85.213.177 mail-ig0-f177.google.com Received: from [209.85.213.177] ([209.85.213.177:55986] helo=mail-ig0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B9/00-05270-B0B20D45 for ; Mon, 02 Feb 2015 20:57:32 -0500 Received: by mail-ig0-f177.google.com with SMTP id z20so21274375igj.4 for ; Mon, 02 Feb 2015 17:57:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=uh7f8OAmA6fh985OMdnqIADx21hNYrmftzRm791iQZE=; b=iB3eDfr8+1sYjG50A3prvPS3gakyDI2H71ycbyupw0VaRnOQY8iUrdDaky4m9cswa3 7G13yWhcYHNIQVGJYpoYu6tDcE+rEH6cMh0t5jJxb6buigOzIQNxyKx6crddU9joNQsH FxP97XWrv/pJ1/hyjuRbl2q1xpcM15FSf15PkAGqxtptLGsZnfvR+QCB3USIdprv6lcV ip7M4BncLRury9rLerkVm1Wrfj6jt0lERvm+/AYsizq1dlar3/9tTEp7yhz1GtV//7E1 MXDkJZraeQaCIEVrnd1ytPM+DJqptMLwn/bEScvETDm4G7n9AMSkDXnwkfFhrfjP4sxn gg8g== MIME-Version: 1.0 X-Received: by 10.50.143.44 with SMTP id sb12mr15195140igb.3.1422928648861; Mon, 02 Feb 2015 17:57:28 -0800 (PST) Received: by 10.64.25.114 with HTTP; Mon, 2 Feb 2015 17:57:28 -0800 (PST) Date: Mon, 2 Feb 2015 20:57:28 -0500 Message-ID: To: PHP Internals Content-Type: multipart/alternative; boundary=001a1134be8ca8123f050e25641c Subject: Serialize generating corrupted data From: jrbasso@gmail.com (Juan Basso) --001a1134be8ca8123f050e25641c Content-Type: text/plain; charset=UTF-8 Hi, I was testing few things today and I released one bug in the serialize function. The serialize function returns a corrupted value when it is serializing an object that contains a __sleep magic method and this method return some key that are not string. Ie: http://viper-7.com/EK16EV If the __sleep returns a string that is not a property it is fine, it will give the notice and the generated response is a valid serialized data (in another words you can use unserialize to retrieve the object back). Ie, http://viper-7.com/H9ooff 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)) 3) Give a warning and return false once the input from __sleep is invalid 4) None of the above alternative 5) Don't change it Thanks, Juan Basso --001a1134be8ca8123f050e25641c--