Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113736 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 78062 invoked from network); 24 Mar 2021 09:59:50 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 24 Mar 2021 09:59:50 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E45F1180508 for ; Wed, 24 Mar 2021 02:55:33 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,FREEMAIL_REPLY, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 24 Mar 2021 02:55:33 -0700 (PDT) Received: by mail-lf1-f42.google.com with SMTP id a198so31000687lfd.7 for ; Wed, 24 Mar 2021 02:55:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JSX38En5529agKdpA0oMQOWFxOrqE3/pg+/Em4m2R2k=; b=GnNhXKHZE5ZH7TeibGNbzJhHqWNgSTSLSKuoRcdouFY3R5mtn41tA5c59XoA9w03Wg WtiQdJgwVdZRuUx6B3MFbja3peI74RH/WaaT9LBipxg/hhixGehtGRzwr7qk/OO0B/2L k0sNlwBOqU66q/7vq9wV27KwjVWzIpvyRrtHgCOgxG/ZewMlIWp3bRw5oqKh3fERSMFI T1BAN1QDhzPfXBDxO6VJOP7BPzGp0MHKogZvXA5JioCwS8TpVJ9en2fAO3kiI8R3F9ZS mNWcrwrH8wAv7PDw8KC2QOE4QZLvr7x1Xlyo53So7VNaRs17W7MpaCr6PPOOl0oLBFGT Nckg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JSX38En5529agKdpA0oMQOWFxOrqE3/pg+/Em4m2R2k=; b=g7qDoHWf1LrmdrvgjUNafRmWp7a4L+dzYtHuL0eK3R+zrGfIeUoDaMPN7utCNPshnL /eOWv4kc74Bvy+wuG1/as31dXAoZn+536t6DIU8bMVR6vp5Mfp/D6BUzsWkT10MrUkyn ucd8Db/aIqqV8QO3dnTIX0zcx1u7Ft+JNSgZw1BacCl4Y7p+OXn9t7kgVIULPD22l7Ku 8evOdO+Xb2IT5waueppDGU3xx+PO6ZfA16b8vEcxidTnhK78YYATiXnAbLlSll2EsWXn wJyrpmIWFa0yIS1E5Pab6xy6XxoEEBbayPpfU99MQ8+OPLlDjN7Ns36HgtG4OOcIu5FF Qzwg== X-Gm-Message-State: AOAM531a6YmbSL9zm57faTMMOxIHm/9JI0ofQ0ewOvkWKxS+xyqLGfi7 y0V3tK3Uh8lnqmhf6OKWjvL8oNFkmrb2nbNxTALyjYKUyPo= X-Google-Smtp-Source: ABdhPJxLft/wpztH1GtlpKASwzpr9DgJnmkXJokO5OPVPIAojOamPFGzW/c/SGD1qdCT9QW3ESh+nTRcjgJKzVvddtA= X-Received: by 2002:ac2:5df6:: with SMTP id z22mr1532964lfq.485.1616579731014; Wed, 24 Mar 2021 02:55:31 -0700 (PDT) MIME-Version: 1.0 References: <20210324103754.2551c075@mcmic-probook.opensides.be> In-Reply-To: <20210324103754.2551c075@mcmic-probook.opensides.be> Date: Wed, 24 Mar 2021 10:55:14 +0100 Message-ID: To: =?UTF-8?Q?C=C3=B4me_Chilliet?= Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000009e47f505be454c44" Subject: Re: [PHP-DEV] [RFC] Phasing out Serializable From: nikita.ppv@gmail.com (Nikita Popov) --0000000000009e47f505be454c44 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Mar 24, 2021 at 10:38 AM C=C3=B4me Chilliet < come.chilliet@fusiondirectory.org> wrote: > Le Tue, 23 Mar 2021 17:01:40 +0100, > Nicolas Grekas a =C3=A9crit : > > Picking up a loose thread: > > > https://wiki.php.net/rfc/custom_object_serialization introduced a > > > replacement for Serializable in PHP 7.4, so it's time to think about > > > deprecating and removing the old mechanism: > > > > > > https://wiki.php.net/rfc/phase_out_serializable > > > > > > This RFC follows a rather conversative approach. In PHP 8.1 there wil= l > be a > > > deprecation warning if Serializable is implemented without also > > > implementing __serialize() and __unserialize(). In PHP 9.0, support f= or > > > Serializable is dropped internally, and only the interface retained. > In PHP > > > 10.0 the interface is dropped as well. > > > > > It is not clear neither in > https://wiki.php.net/rfc/custom_object_serialization > nor in the documentation if it is possible to call parent::__serialize() > to > only add a few fields to serialization. > > Is this legal/correct/useful: > > public __serialize ( ) : array > { > $data =3D parent::__serialize(); > $data['specialField'] =3D $data['special']->complicatedStuff(); > unset($data['special']); > return $data; > } > > public __unserialize ( array $data ) : void > { > $data['special'] =3D new SpecialComplicatedThing($data['specialField'])= ; > unset($data['specialField']); > parent::__unserialize($data); > } > Yes, this is possible. Regards, Nikita --0000000000009e47f505be454c44--