Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129226 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id 3B4D81A00BC for ; Fri, 14 Nov 2025 22:51:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1763160711; bh=0g4y75PFcDN3mzVkhnkNdDiwde7G+m6pDcBCIjpGfno=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=HCLFix0AmLVmY/cBIAXgQeYyxEKvpyG3yXCTYDVJPbJCfebx7yDlndkbP6RrtjjQb e2B3E93ESSnm/XMdwajXnexGUliB+npzvaQG4u/geeyTZ+7R8FJ2JXeM9o/O/8iGfQ 5h4URq0yxxLNLOqJdMyrH4zJNbaoivp9Eabqx6DU24q+WPkoXJDHkfoOOW9U+N7LwA v/x71Wvb00Xkmoqht7POWNp0TsThYU6bE77n/X/xWYf+7LVBPFcalw+ukjOz2DgS6E p0HIuQKKPdtim0jKQTGf4rWkQZRnr68xwuPNG95/1ITQlO5k5P62NI0TLn7/2krOUr yLD3koruiE9Ug== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E962F180057 for ; Fri, 14 Nov 2025 22:51:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (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 ; Fri, 14 Nov 2025 22:51:40 +0000 (UTC) Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-7b22ffa2a88so1961636b3a.1 for ; Fri, 14 Nov 2025 14:51:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763160695; x=1763765495; darn=lists.php.net; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=du1zMC0s7x36GK3KpwTUt0uuGZgqtgrHBvXmYEB4aQU=; b=O096RK3/LfadnMnNf6pY6NeuFPThnHGCnrjvC5awrDd9WdcY0ZOL+6WoytQgKUgU8C 6GZjCXgo/9pthq0w3beg6BxyjSze3Nv9H49e4ocbEGDyz+K8pFTYDIt1PP3e2/7kAN6G 2x7KXN8WcEWZO1/aQYvPkOtJvItK0sirLlqYm/2/ZuvtSGUo9IkjdD2XgxZShxbHrduc MKbdLH3I+ZEqI5itkh/bnvgytAZoJXehWRfjGV1wkwM6aufjD5mwiBpPYJftTVxnpEVK u0SnL84JKQOsOcg7pz0SbZr/vDs+IDfSJh+ojznMTLSyfuVBPs8HJdqfnlVMYZlLRvQd dvVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763160695; x=1763765495; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=du1zMC0s7x36GK3KpwTUt0uuGZgqtgrHBvXmYEB4aQU=; b=ptY++ymDvTsFBpJ4lMxIkw3bz8YBU8GvA0PQsv6AxsqLtuPdzhuIKL6oI4aE8ewyU0 HSpTlhdiGFZu2Wh9iyddyhBUeg52K3ccOMSaZKc0klKd2621IL8f3UnkkCsFXbvghGcI UlSrLUbtink6TK1Ayb/mDOfNlT9c4XeXx7mEarlwBxahEMgjNr9jbWA70UmjyEO4vClf gRyPaf+eVjDqzA3lZRjvHGtgellCQpaZwQAFb6/aVc3/d04odJq1DfDOqXMigcCTGQyD 3z/qmSf3hBGmnzUdP9mYN9bec5Wozzcs+ULwZDZ5yxHxT3Za7+BvTNEvDCdmsZ4L44vD yA4A== X-Forwarded-Encrypted: i=1; AJvYcCXueap8kA8ujXfgGoV2GfC9tqo/b9EHkTQvMEnW9XGWM3i7CN4sFi2L4Y48epHiJ9hZUd45cvgJwx4=@lists.php.net X-Gm-Message-State: AOJu0Yz4l//N2fMHEl4SJd/u3bY7gKb+aHV7HXRjtc5ZXV7VrqSbDlVB NqKPfyuKzLN9hhc51Rh63GWJBN/qhEXIYu9UTbU5ycD4Yz1e55RY3k1h6kt7imdmCjtf07SPX9U e8VTL8rOVvVhf30DsKkjkXCProb1ErHo= X-Gm-Gg: ASbGncsZVjS3O3lu33zcIJDw6q956+aYFEFz2CLeVbAxZu2nK0FOwVffC4JHaxyz6fI VtnQc2InJ0T8PD2uyz8zn5EohIhQilPH2RPBAkv3XQ1xMa11TEtnzpUk/3OWZDXWVqzDsDtcEFJ wrFN406edKpCqMebzwzXcuSmdLCOWvKhDzYKoG7XY8TgT3rZ4EVUaO8zevrZF55O4TxDxd5knYB N3auSRdq3TWbmucAT6KJIRWHPu1xNMJV01unoCPlsA4YGgUIlp/4vhSsYWQFo5vO/cr5khBY9Go /MKDRVKly1A5Xln3ZhRE2pjwSAk= X-Google-Smtp-Source: AGHT+IETB82GIHiyHkBCakm8Z41DqGq+q+uZjqlAFdpDDpGbcQ33WjXT5GAglwzn4lPXoUZ7bsZsGLOGDn/wXCU/l9s= X-Received: by 2002:a05:7022:ff47:b0:11a:4016:44a5 with SMTP id a92af1059eb24-11b410f50f1mr1698027c88.24.1763160694532; Fri, 14 Nov 2025 14:51:34 -0800 (PST) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: <4b6abc36d8ab6cd306e95141869db3b0@bastelstu.be> <21ff8dee5016a1b7ecc412c44233abd1@bastelstu.be> <3a20b5ef66fc23de6bad022685b41190@bastelstu.be> <4e3061bfaa5218309041460d31be2856@bastelstu.be> In-Reply-To: <4e3061bfaa5218309041460d31be2856@bastelstu.be> Date: Sat, 15 Nov 2025 00:51:23 +0200 X-Gm-Features: AWmQ_bnaNaRD1hrw194Vi3n6wg9-2vXP3W2tKcFgnMCTElxm081V1BL02Sgk788 Message-ID: Subject: Re: [PHP-DEV] [RFC][Discussion] Add #[NoSerialize] attribute for excluding properties or classes from serialization To: =?UTF-8?Q?Tim_D=C3=BCsterhus?= Cc: Ilija Tovilo , PHP internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: lnkvisitor.ts@gmail.com (Dmytro Kulyk) =D0=BF=D1=82, 7 =D0=BB=D0=B8=D1=81=D1=82. 2025=E2=80=AF=D1=80. =D0=BE 12:57= Tim D=C3=BCsterhus =D0=BF=D0=B8=D1=88=D0=B5: > > Thank you. The updated RFC is looking good to me. I also appreciate that > you kept a changelog within the RFC. > > One thing you could mention and that should be done as part of the RFC > is migrating all existing classes with `@not-serializable` to make use > of the attribute instead. That's also what has been done when the > `#[\Deprecated]` attribute was introduced. Other than that, I don't have > any further comments. > Thank you for the review and the helpful suggestion. I agree that all internal classes currently annotated with @not-serializable should also receive the corresponding #[\NoSerialize] attribute as part of this RFC. This ensures that internal metadata, reflection, and userland tooling remain fully aligned, and that the behavior is consistently exposed at both the engine and stub levels. The RFC has been updated to explicitly state that these attributes will be added for all such internal classes. I also have one technical question regarding stub generation: When attributes are emitted into generated arginfo.h files, should the generator automatically include zend_attributes.h? This would avoid requiring extensions to include zend_attributes.h explicitly when they do not use attributes themselves but only include generated stubs that reference them. Before making any implementation adjustments, I=E2=80=99d appreciate confirmation that this approach is acceptable within the current stub-generation design. ``` /* This is a generated file, edit the .stub.php file instead. * Stub hash: 2fc12d1fde65efbec4305f4934a3f4b25282a552 */ #include "zend_attributes.h" ... zend_add_class_attribute(class_entry, ZSTR_KNOWN(ZEND_STR_NO_SERIALIZE)= , 0); ... ``` Best regards, Dmytro