Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68319 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15191 invoked from network); 26 Jul 2013 10:58:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jul 2013 10:58:44 -0000 Authentication-Results: pb1.pair.com header.from=jakub.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=jakub.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.54 as permitted sender) X-PHP-List-Original-Sender: jakub.php@gmail.com X-Host-Fingerprint: 209.85.216.54 mail-qa0-f54.google.com Received: from [209.85.216.54] ([209.85.216.54:38230] helo=mail-qa0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7F/64-25917-26652F15 for ; Fri, 26 Jul 2013 06:58:43 -0400 Received: by mail-qa0-f54.google.com with SMTP id bv4so338940qab.6 for ; Fri, 26 Jul 2013 03:58:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=/vW8fi0GSlSoKQfNZEf25dyW/tQSYTcPXsYiv3f8GO8=; b=uAi6I0VNmVeRWmdSATPfHuMdnmxGkj3SWaj3kSeUFfC4w5ZTdN+oJslzMUQzVRtqxV LOldcVnrlQS9TcZmpAFjZOWRmYKPJ1bTeZhzPjYXYHrCVRjmva0bc0Lu91eoEvPrTEzl Yoz+eXiIZd1O9yb9IL+TYZ11lGJ1Em2GRzd79wsHVImWlmrDZzuG68H3k4SlSWlF1Gq0 P/geKH27hr6zvFLh3li4k24AK4ZK0Zrtmc26jLIAlUXouE3mxr8qfAe+RcJTmwfrl/5Z hJR67+DZXUvT1lJLQEHwIhwfmLfYMk0vjubFv4LvTTq30NP6yn7KYdb7HmiIxzfKbc+c lPbQ== MIME-Version: 1.0 X-Received: by 10.224.147.141 with SMTP id l13mr16737148qav.102.1374836319625; Fri, 26 Jul 2013 03:58:39 -0700 (PDT) Sender: jakub.php@gmail.com Received: by 10.224.178.69 with HTTP; Fri, 26 Jul 2013 03:58:39 -0700 (PDT) In-Reply-To: <1374833069.3605.2106.camel@guybrush> References: <51F177E7.3020103@sugarcrm.com> <51F182D2.7030007@sugarcrm.com> <1374793278.3605.1436.camel@guybrush> <1374833069.3605.2106.camel@guybrush> Date: Fri, 26 Jul 2013 11:58:39 +0100 X-Google-Sender-Auth: Yzi-n3njtad1aANkwY_1zMRk6Cc Message-ID: To: =?ISO-8859-1?Q?Johannes_Schl=FCter?= Cc: Stas Malyshev , Nikita Popov , PHP internals list , "nikic@php.net" Content-Type: multipart/alternative; boundary=089e0149cdb474a43a04e2680668 Subject: Re: [PHP-DEV] New handler for retrieving properties when object is serialized From: bukka@php.net (Jakub Zelenka) --089e0149cdb474a43a04e2680668 Content-Type: text/plain; charset=ISO-8859-1 > > So rather change the engine, which affects way more things and add yet > another serialisation hook making it even more confusing what to use? > > > Yes I agree that the new hook is confusing. I think that what Gustavo said would be actually much better. Having some flag that would say what is the purpose of retrieving properties could be very useful. It's not just serialization but also casting object to array. There can be even more use cases in the future. On top of it the hooks like get_gc and get_debug_info could be part of it. But I would rather discuss this leter when I send a patch. > > You're solution also depends on an API break and also changes the way > the objects behave during serialization/unserialization. > > Not sure what you mean by API break and changing the way the objects behave? When you look to this pach https://github.com/bukka/php-src/compare/date_serialize there shouldn't be any difference in object behaviour. Or am I wrong? By BC I meant the resulted string that you get after using serialize function. If you use Serializable you get something that is prefixed by C: . But if you have object, the prefix is O: . Please see this http://3v4l.org/Sd8aT . Jakub --089e0149cdb474a43a04e2680668--