Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121970 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 46970 invoked from network); 9 Dec 2023 15:32:15 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 9 Dec 2023 15:32:15 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B9DBC180003 for ; Sat, 9 Dec 2023 07:32:29 -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,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mx1.dfw.automattic.com (mx1.dfw.automattic.com [192.0.84.151]) (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 ; Sat, 9 Dec 2023 07:32:29 -0800 (PST) Received: from localhost (localhost.localdomain [127.0.0.1]) by mx1.dfw.automattic.com (Postfix) with ESMTP id 7290B1DB558 for ; Sat, 9 Dec 2023 15:32:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=automattic.com; h=x-mailer:references:message-id:content-transfer-encoding:date :date:in-reply-to:subject:subject:mime-version:content-type :content-type:from:from:received:received:received:received :received:received; s=automattic1; t=1702135934; bh=uZMtZk2PTkJY qhH9eT4FX66MppFrbRN+ETXvaoSMJNI=; b=NMmCH5hkzTC8aESYYgOhzb+uzXTd i4OKbSv1YtPUXqf/vFabBoEf9KWm8sTFEEWfaycy4BP5XgN1TRiKDmBLRcQIXZZn UXFgzDk8JEThvyQPzMmH+/yINeYJiEUwtlFN2EPYusolkN791TaKDRdDmUsUNzFa N4fp8VgyOoI9L8AehknT8Zgjt3FkKY+SQTVnWW0oZzF8CpnoiOWBYuHAewjAKGdZ 5CfxVFvT2QedPnmSud+JbCWDhPyxSSQWuTKMBWiEluvCJYE3g8bluTDkq5YtA4kk VbXCALtWG5PCF6jwylys0sJcnVUY2lBXaokl/uayIEy74GFs3EThBhJfJw== X-Virus-Scanned: Debian amavisd-new at wordpress.com Received: from mx1.dfw.automattic.com ([127.0.0.1]) by localhost (mx1.dfw.automattic.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id awkYlYtymDmj for ; Sat, 9 Dec 2023 15:32:14 +0000 (UTC) Received: from smtp-gw2.dfw.automattic.com (smtp-gw2.dfw.automattic.com [192.0.95.72]) (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 mx1.dfw.automattic.com (Postfix) with ESMTPS id 01B331DB48A for ; Sat, 9 Dec 2023 15:32:14 +0000 (UTC) Authentication-Results: mail.automattic.com; dkim=pass (2048-bit key; unprotected) header.d=automattic.com header.i=@automattic.com header.b="ecs2eVik"; dkim=pass (2048-bit key; unprotected) header.d=automattic.com header.i=@automattic.com header.b="U4QUkU34"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=automattic.com header.i=@automattic.com header.b="Qes2/Qbz"; dkim-atps=neutral Received: from smtp-gw2.dfw.automattic.com (localhost.localdomain [127.0.0.1]) (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 smtp-gw2.dfw.automattic.com (Postfix) with ESMTPS id E62CCA0385 for ; Sat, 9 Dec 2023 15:32:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=automattic.com; s=automattic2; t=1702135933; bh=uZMtZk2PTkJYqhH9eT4FX66MppFrbRN+ETXvaoSMJNI=; h=From:Subject:In-Reply-To:Date:Cc:References:To:From; b=ecs2eVik3eBPJL9f8nbgl38crrjFZw/w3B0vzRKnMrcBGQDAPueGJMcSveUEMILsb Uln27b+BNHL2yX2l8f7/Rf/U2RXysEXoWizseIPjJz+84Zo8BHKQ1Co3VupQoBKKJT QqS3bTfFd1T04bkd1MFeVSLWb6Jzv1jEqZnxMatGpjV2o8CSUKSNZe1+os1xfWYUWh RU/1b9MR+2HCrZ4R8GLdweTB+It3LsP6qEfLTPy9bAIA5mXcCRnsLxhE1NiTcUd/18 P7b45HMtE7xBMQy9hZfMrYA0Ed81lG5F2SEWUyvTBpn1RWcm6lcHy//DRrqNHBND2u vz3NsAVIQBl4Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=automattic.com; s=automattic1; t=1702135933; bh=uZMtZk2PTkJYqhH9eT4FX66MppFrbRN+ETXvaoSMJNI=; h=From:Subject:In-Reply-To:Date:Cc:References:To:From; b=U4QUkU34NOCsqS4YZbqeQmk4InvCpnb3i7P6IPuVzKvd018WE18qJxbut8zOufLim 0nBp/nYCL0Q85qp6k1UtgkCM1q4hdMnMZNIn561EO04EWLGGPRzGDRdL+GIbzjP7mx qTrFZC8sQng0884BFaAqNoQigmqejoupG+2uddNXKgsJtuYLjz+npRoDMx5esaLpiV pOzSH3wGXpCDhiyOZ01csqzn+735eZB77SopZD9bDqOpkYgAMPfmRtcQ++HuTSdi7h EJhdQDhoLRj9Lh3qS8np30inA2Z62GgpuOQ2evIh3//OkWFXijhTO+UKeZZ4HzWaen VmXDkk/7A/kZQ== Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-gw2.dfw.automattic.com (Postfix) with ESMTPS id CFB58A0284 for ; Sat, 9 Dec 2023 15:32:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=automattic.com; s=automattic2; t=1702135933; bh=uZMtZk2PTkJYqhH9eT4FX66MppFrbRN+ETXvaoSMJNI=; h=From:Subject:In-Reply-To:Date:Cc:References:To:From; b=Qes2/QbzXtLud2+xQ+7ZWz9qOx2v4VZCql8Rew5T+cY1KBehyQ43ia2kVvdSUVJg6 gkOiksDEtAkmpkO1XJsnDLq7650L+oLRuo4CxYgCMeoJ55q55AGWPcEay4hkxTDqMS irpVOfsjtpeQ5iCNgJY8hG79qHujHIRLeugAL8nPSBZXrp6qHkDBjLWxXD7cXd8Hpl 8+CN1dFNRAhCUopCwi0er1tXVpLMClXU/FKl1AFpS3iH9tBXRRBNcSBm9PbtoC3Fnu 0KA0JxaVVJnaspkqjkqUpwWIjVhbjWWvxsxPrxFxDBKIs5zFFyekLfjEVeu4wdKmh7 fU4F0kql5d35w== Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-40bd5ea7aeaso19165815e9.2 for ; Sat, 09 Dec 2023 07:32:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702135932; x=1702740732; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:subject:mime-version:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uZMtZk2PTkJYqhH9eT4FX66MppFrbRN+ETXvaoSMJNI=; b=bWXZDgrf4xRbj6HGp5ica2SEqOkE44tjXvODsqW1avq35YlRbwAg8UkPgkq7IIC4WP DZ1syC57Z8bvCU4KqX7LfOdsR84Zr7x6oZ72ftsSV8QvcTjiU/LgoPmTSVD/4r+cCZAa EwbGCLHAYoHtfZKWu/1/KjSsuO85d0WFhawIEzKIX6wnCC9LqExfQz9a0Cev08zmxrJv GRd5AtxlqYIO4rx4yA/ZWGZRkc6GsbEtlOy7I6WOGNydVnEitajWgiDdA1SV/+1JUs6f x+qQX4Cz9N6JWid68mefwU465SIHtxfq9NHHCxHl5EhW2m/yyQhkOg0traw9jzD8zBdM Yq2Q== X-Gm-Message-State: AOJu0YxOd5cyzKTJPfmT6AmAwz13Ym42LrqfAkwZlQhPOo0xte2BVi8g OXYG3hqRhJQCtm+bgasbEumVUovWW6phBQKILpbTSHheEWG174eSy/DNaPIFY6cC0tW01yM09nJ UDMVKzreiiJ+GtSeDFg== X-Received: by 2002:a05:600c:21cf:b0:40c:2bb5:f8d with SMTP id x15-20020a05600c21cf00b0040c2bb50f8dmr1098827wmj.123.1702135932605; Sat, 09 Dec 2023 07:32:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IFjoOhFG2UGaBQuSb2oYMk3HmxyqHGL9wcUV0gupMZ00R4NvTB6alZvLqDVdxdbLd/7wtzQ0A== X-Received: by 2002:a05:600c:21cf:b0:40c:2bb5:f8d with SMTP id x15-20020a05600c21cf00b0040c2bb50f8dmr1098818wmj.123.1702135932218; Sat, 09 Dec 2023 07:32:12 -0800 (PST) Received: from smtpclient.apple (c144-230.i06-5.onvol.net. [77.71.144.230]) by smtp.gmail.com with ESMTPSA id t14-20020a5d42ce000000b003333b0d603bsm4553578wrr.42.2023.12.09.07.32.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Dec 2023 07:32:11 -0800 (PST) Reply-To: Dennis Snell X-Google-Original-From: Dennis Snell Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.200.91.1.1\)) In-Reply-To: Date: Sat, 9 Dec 2023 16:31:59 +0100 Cc: Internals Content-Transfer-Encoding: quoted-printable Message-ID: <1BF39851-A294-44D9-827F-933B00807441@automattic.com> References: To: Max Semenik X-Mailer: Apple Mail (2.3774.200.91.1.1) Subject: Re: [RFC][Discussion] NotSerializable attribute From: internals@lists.php.net ("Dennis Snell via internals") Max, I love this idea. Would it make sense to flip the design though and add `#[Serializable]` = with a new `php.ini` setting? I=E2=80=99m thinking that almost every class I use, if not every single = class, should not be serialized. If PHP had a flag to say =E2=80=9Cprevent all classes from = serializing=E2=80=9D then I could toggle that flag and avoid changing every single one of the potentially thousands of classes = in my codebase, and I wouldn=E2=80=99t have to worry about ensuring that everyone creating a = new class remembers to add this attribute. For existing sites with serializable classes we can leave the default of = this new flag to the permissive legacy behavior: every class is serializable. However, if you = are willing and have vetted your code you can flip that flag and now _unless_ you explicitly = declare serializability support, your classes don=E2=80=99t serialize or unserialize. That could point to a future where _no_ class serializes _unless_ it = implements `__sleep()` and `__wakeup()` or `Serializable`, which seems quite reasonable in my = mind as a tradeoff between explicitness and surprise. Warmly, Dennis Snell > On Dec 9, 2023, at 1:30=E2=80=AFPM, Max Semenik = wrote: >=20 > Hi, I'd like to propose a new attribute, #[NotSerializable]. This > functionality is already available for internal classes - userspace = should > benefit from it, too. >=20 > The RFC: https://wiki.php.net/rfc/not_serializable > Proposed implementation: https://github.com/php/php-src/pull/12788 >=20 > Please let me know what you think. >=20 > --=20 > Best regards, > Max Semenik >=20 > --0000000000006c4879060c12de83-- >=20