Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129670 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 50C1C1A00BC for ; Mon, 22 Dec 2025 10:13:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1766398402; bh=X5mcdCOUV8Gy9QJdQIamjqAgSCa4adLEYSnmw7qdyys=; h=From:Date:Subject:To:From; b=IbT3fNyPvNsPS9k0LSc5NKhWy/vx5/shHRqTx34TvwsevaSL0vy/1lBFvn/4ucui1 HqncM72uPGreJihdOZBCw7ik8MBEyeDURgLJwWQj2zkPY0rQsPRE7XE/xo9esxWFhk 7ChZ3PeYRk8Z6Xxw1vkK0PGbH4snnUaKxnZAsiNVfWxU3TTNX7jfAULrtxJ8GQylFu WUZfnV697OI016CMc4hNos6ccLRvZr75Jluk2cYb7sNvA+Fp01nHx68GRi0RcEAqvI C2F7wGlYUQ3zmJ4KpVYXBenTwwMgPV/V21CGmxkXuUXqXcJyVYyKJm0/IftWtWuB/U xe5lQ9VIk1eOg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E408B180087 for ; Mon, 22 Dec 2025 10:13:18 +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, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, T_SPF_TEMPERROR autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-oi1-f180.google.com (mail-oi1-f180.google.com [209.85.167.180]) (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 ; Mon, 22 Dec 2025 10:13:18 +0000 (UTC) Received: by mail-oi1-f180.google.com with SMTP id 5614622812f47-455749af2e1so2933038b6e.1 for ; Mon, 22 Dec 2025 02:13:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766398393; x=1767003193; darn=lists.php.net; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=X5mcdCOUV8Gy9QJdQIamjqAgSCa4adLEYSnmw7qdyys=; b=RrVnsDWSx0Y9I06nsBoDXoxaQ5ty7aR6a6PBkLtbL0ZKTl7CHKamo3JkAk2cSCjlVa bpyoOnVNpgdqxFI5jZdQHgyhTqppogKqQLXkZzrsd+cb+QBONHp7z/qRIro0aXa6woaV Wwn0YGxuLnKGk8ZSrTmB+48rBrVRhfn9yF3YceOsEnt/jj/NAajqyrePlO3rW9pZHe6w Gg3ViXaf6CkplMWy1QmADUyH09NZCp+9Pc1+ex+YBQIoZd8MLewviamnqJUs7Elt+m9T woJT2A6c3cbyCIDrXfjxfNRNtlUOlJktYYhQophQtflbwWLSBZkJezR87J4V/fDD6s/n 5VzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766398393; x=1767003193; h=to:subject:message-id:date:from:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=X5mcdCOUV8Gy9QJdQIamjqAgSCa4adLEYSnmw7qdyys=; b=Z9N4LC2FvEkyrKXYJajlM/zsFeiXS2ZfmbrCEngLMobb4KfUQHPOv/kL5mnvka/vt4 jZMO/Fa5Ao6OLzxxlbNmEmthPDaB84N6Vr9DKjI3wfB+Jr5rDn9mORBUsnmyo/uosz8y uKvs2lvWdc2RO9haiiv4DWgshRNfY6+71ZvbY7CY/Ie4Kskur6xyhkH1ouHtryH57k79 ac0bYQUj1KUa7ydhV+MVCd4G8jDkeQC4f6eey8wbKruPmv08DyFuWlNgBDE0W67cwuO7 DwnT0ltO6btnmxrIb5Jinj/VMo+w/9L1WPFL5kl+BlKn3pJkPUNzBsplYS/eSyEWtjzN /GmQ== X-Gm-Message-State: AOJu0YwN/z8ybpSu5LgWHk3gbREDf5P1j4tz8vNs46i4x/ivb/OP4Shm jn1g2NfaE6xzwVt4AWcAOmN2CdkpOqKbw5RvNAqYwFJYagSSKeek5vdb1FAuFQf/lt0t7TzOWwq Us1t+p/pER3Vfk/+kbcmMEoixvNl6bocnetHK X-Gm-Gg: AY/fxX4bTTthN/kdtm/vqyr31JJXFSd4nAQZgZ9YVY0EVXcRhY118STEw5svEZEQCxy oMZUClPrJP/qvw89Iec6TjVMItSxkLmvqZXrlvGU4iFZqVYAOa3453JSgQPzK6FRJijI1x7ciBy IYSCH5dHxWVTEc0I1Izp4PD2nF7AFiT4L4G5ZUPIg8AEJgKK8onAULLNgwZEDJrlEAja3xvNoXD TpPGi7MDWLUqW6+1VbQg+7gHVWJBT+rdSjWzuZJoPB6bbfRRHp2QMHp2rfG4/Q9eV4NaHOn7i5M AlCrKrpLSSO1v1rHP9vZr8WenpcFjg== X-Google-Smtp-Source: AGHT+IHD3UfAFyFyANnf2fubhbZ2Q4VpJ+jWqSeo7EOnWKzCOiWsMQ6lGOijtR3g9sD5UG8lftDtTxC8cAD/rHcNCAA= X-Received: by 2002:a05:6820:4088:b0:659:9a49:8e26 with SMTP id 006d021491bc7-65cfe748a32mr5874801eaf.24.1766398392699; Mon, 22 Dec 2025 02:13:12 -0800 (PST) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Date: Mon, 22 Dec 2025 11:13:00 +0100 X-Gm-Features: AQt7F2p_DAi06OcEuARM1HoBrOwvu0nXfCNdVb-W1TDGvUf7_rSAwfsrUE66xWM Message-ID: Subject: [PHP-DEV] Backed Enum and serialization To: PHP Internals List Content-Type: multipart/alternative; boundary="000000000000ba9072064687acb9" From: nyamsprod@gmail.com (ignace nyamagana butera) --000000000000ba9072064687acb9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi all, recently through M=C3=A1t=C3=A9, I discovered that Backed Enum behaviour wa= s changed for http_build_query in PHP8.4 see the github PR https://github.com/php/php-src/issues/15650 This change was never discussed on the mailing list and seems to have been prompt to align with a SOAP client serialization fix and to align with how BackedEnum are serialized using json_encode. Now I believe the PHP does some serialization elsewhere for instance when using fputcsv. My question is should Backed Enum also be handled differently in case of fputcsv ? IMHO if we want consistency in the PHP language the answer should be yes and have BackedEnum converted to their value (string or int) before serialization. Either way I believe a discussion about it should take place. My goal would be to have a clear rule on how Backed Enum is serialized across PHP regardless of the feature. I have not made any attempt at screening or searching for all serialization mechanisms in PHP but I presume they should all be listed and updated to follow the same rule for consistency. Best regards, Ignace --000000000000ba9072064687acb9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi all,
recently through M=C3=A1t=C3=A9, I discovered = that Backed Enum behaviour was changed for http_build_query in PHP8.4 see t= he github PR=C2=A0h= ttps://github.com/php/php-src/issues/15650
This change was ne= ver discussed on the mailing list and seems to have been prompt to align wi= th a SOAP client serialization fix and to align with how BackedEnum are ser= ialized
using json_encode.

Now I believe= the PHP does some serialization elsewhere for instance when using fputcsv.= My question is should Backed Enum also be handled differently in case of f= putcsv ?

IMHO if we want=C2=A0consistency in the P= HP language the answer should be yes and have BackedEnum converted to their= value (string
or int) before serialization. Either way I believe= a discussion about it should take place. My goal would be=C2=A0to have a c= lear rule on how=C2=A0Backed Enum is serialized across=C2=A0PHP regardless<= /div>
of the feature. I have not made any attempt at screening or searc= hing for all serialization mechanisms in PHP but I presume they should all = be listed and updated to follow the same rule
for consistency.

Best regards,
Ignace
--000000000000ba9072064687acb9--