Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121979 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 8654 invoked from network); 10 Dec 2023 16:49:34 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 Dec 2023 16:49:34 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0E65818004E for ; Sun, 10 Dec 2023 08:49:49 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 10 Dec 2023 08:49:48 -0800 (PST) Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a1c7d8f89a5so491936266b.2 for ; Sun, 10 Dec 2023 08:49:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702226972; x=1702831772; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=caM9KsRUhIBAY7/f/cJWqfOy76GjbRYT+K38aXX25BU=; b=iW8jTPNZAmmzYUw8/DoSS3usVi3UgKtEDWGpczQjQoOi0+CaX46Fhjym3t66VVL3qb Q/DiI//1nGa+bHsPa0LOgTsNzfMQsO/GNV7tptau67ovkuR0PyppplSy1IgXzZMcmkCm a95T/1PEZ9tsJnIpg7Y+gzCOxO3NX7G5yVlhA87/n2vlgXz9j2rdGwVUUrf0DUO7eaxj zqzTQxMZGBqPefBPLfXJ+l/KSouby7YAiFEDsUuSr8e0Hgp++qKu/j5dC4Eyqvy1kWqN YUqeXjFNJh5ysf6yQCLu8S+ARS3ZK7T9vZLrNQsAjrF6u+q7xfLomFXDQ1q6He7Rpgip waMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702226972; x=1702831772; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=caM9KsRUhIBAY7/f/cJWqfOy76GjbRYT+K38aXX25BU=; b=J9T8fOV9Kq+Bsu6UE1dBVZFz2i+yfVXRgkA0uieAvXtFHCDHsmSDwLe6Yk+h71/9wj GG7809Uowa5njktRnppWgNZEnip98LeX2UsK4XG3SmS1UPtfUr+lYkMtoK+CHOqQU1b7 vYy/ZEnapmCn16TSaDUCGaKbEHoK2QQpoal1vrAkjO/P0LN+vy1N80PUkYS2l7hdXe51 cJGESAu/47Iaw6Kujdy1NGWqKZPIOFQgm3Y0D+u7DO0uR9Rhw6d8UoQn3Oho81YaKVOs 9zlbc8rhXxq8gHfHxxYr4jjNxyUEkdPciWJvkapG/CEe/LtDEkliWAt/Qup9LD0E/JTK qC6A== X-Gm-Message-State: AOJu0YynNBN9cW+VuYqOUEEhbps1b9a87jmbEi/yXfsHtvKFHOeUV6/R dXzGZu8nV4FcHh0kfUourOMPuH3UeVecXxK601Y= X-Google-Smtp-Source: AGHT+IHYPZL/hXwdZ0eHYB8r9aHdyOGUU33gf/dNqeDX7KOwR22XMHBhsHeyI3CAkIVt/NbDhAMVSf4K9U+Ttl5l0yk= X-Received: by 2002:a17:907:948a:b0:a1e:f267:3e1d with SMTP id dm10-20020a170907948a00b00a1ef2673e1dmr1896037ejc.3.1702226971689; Sun, 10 Dec 2023 08:49:31 -0800 (PST) MIME-Version: 1.0 References: <54BE3A8E-046E-495E-B371-CCF917B6BB49@gmail.com> In-Reply-To: Date: Sun, 10 Dec 2023 19:49:19 +0300 Message-ID: To: "G. P. B." Cc: Rowan Tommins , internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000f98991060c2a991c" Subject: Re: [PHP-DEV] [RFC][Discussion] NotSerializable attribute From: maxsem.wiki@gmail.com (Max Semenik) --000000000000f98991060c2a991c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Dec 9, 2023 at 7:18=E2=80=AFPM Niels Dossche wrote: > If you instead put #[NotSerializable] on the parent class MyClass, then > the child class won't be serializable even if you implement the > serialization methods in the child. > Is this intentional? If yes, this should probably be clarified in the tex= t. Elaborated about the inheritance in the RFC and added a test around it in the PR. On Sat, Dec 9, 2023 at 7:29=E2=80=AFPM Larry Garfield wrote: > My main concern is that, as noted, *most* classes probably aren't > realistically serializable. Basically any service class should never be > serialized, ever, and anything that depends on a service class should nev= er > be serialized, ever. So for this attribute to have the desired effect, i= t > would need to be added to most classes in a codebase. Which seems... lik= e > a lot of work. In an ideal world serializability would be opt-in, but we > do not live in that world. > Indeed, adding it to every service would be an annoying overkill, but I wanted to use it on classes that should *really* not be (de)serialized. On Sun, Dec 10, 2023 at 2:46=E2=80=AFAM G. P. B. = wrote: > Moreover, having this as an attribute means, that even without adding a n= ew > method to ReflectionClass, you could determine via Reflection if this class > is serializable or not. > Because currently, the only way to know if it is *actually* serializable = is > to call serialize() on the object and see what happens. > I've amended the RFC with proposed ReflectionClass additions. --=20 Best regards, Max Semenik --000000000000f98991060c2a991c--