Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125407 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 qa.php.net (Postfix) with ESMTPS id 03A141A00BD for ; Tue, 3 Sep 2024 11:24:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1725362815; bh=5dyGYx3b/uIBrh0JeaUkkxfxbxOsDu5DCQuiadU3Ui0=; h=From:Date:Subject:To:From; b=gIZGOSgkzvXs6LsPRxRfkSl7x+N6UrMbKk8XzhaMIXMFX+2d2gdogZb4EfPibpEHM CKr6BVevvLu7HR6YY1WdZbYuUapt54+8u/IxrV2+EhUsVus6dzAc9bf7BcOAUkgOdh /aHdyTq1T90Mp/KxV/TJNhKsxUffoQmIyjGDCBHy3UkI52aTe+jr+Fes7pjxPqklqn 4Dkdur792nT24TjwzHqRkiuCsUtbFcfBQQ9TrOf6rN1Ox3sV8ZdxCFQmMG3oVcEj/d BKP1Y2DE0cDgP57nnaQfPTtz204edTUphexLoYRRznUArKppls7nLUtsOl2OXCrMkR fsNWz9XjDHEiA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BEA55180069 for ; Tue, 3 Sep 2024 11:26:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) 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_MISSING,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-oi1-f169.google.com (mail-oi1-f169.google.com [209.85.167.169]) (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 ; Tue, 3 Sep 2024 11:26:54 +0000 (UTC) Received: by mail-oi1-f169.google.com with SMTP id 5614622812f47-3df04a2420aso2508561b6e.1 for ; Tue, 03 Sep 2024 04:24:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sensational.ch; s=google; t=1725362696; x=1725967496; darn=lists.php.net; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=5dyGYx3b/uIBrh0JeaUkkxfxbxOsDu5DCQuiadU3Ui0=; b=FjVx3PsJk8Oov+1Ae0SQVHhY5TVnfmax9bh/H6JLuxBhzA+pe0OIunNJ7JiHkgarCd 3HtGpASBrQ862kjaXc7v8EL+vuENh+7xxfvQ8VNGJw2LeToyf9/ags2xBW++xVlr110d rU5hmuYfL0X5xi9rcIynN3FHze0psW9NDWB9z//xyTZyZQT0IdKaXjRLyR8H3q9qFp5x iVZveSN72naWPX5bw4RhJ0o8C0bbgAN/gNmMl1MaqovkI85XnDrxHGY9poPYZI/Q/kCY VOqUYYSXQRe9FOt8yyZDTNj4djfDfim+Heu/6KYDRMVSBIfss0owQs13VGVJT/FjSXA1 Tpcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725362696; x=1725967496; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=5dyGYx3b/uIBrh0JeaUkkxfxbxOsDu5DCQuiadU3Ui0=; b=CMY1Lmm+/B3lFnKnZ5pv92cauQQtjwUMjMd41tn33SKJTb7rhgzfuK0tnhuWO4sbva Cv7hOKEfKBsQf9u7sWgdZ9m6lrdUctcyDznzgEJHXo7YZ9W0jQNgr7siPzR0rFdhBYAy xRnaBtkoZMQfeqhQ7AQJpoPxoWpn8oNod3EWS7t4vOeS3g0GIWHAgHgUvdmTjMJz8+Mp wu0LHP22KhSPX4zYyJrx9r6gqMbn35ZUbOWAdwfIZvMol/oVjCwGkfhH2JB5e9AMobeZ R1Y0Pr8G36V9CittYrw8yDoju/Re5tHIv3naodoIjlNPppMqEvghVEu7mWZ3101DWSUD MoVA== X-Gm-Message-State: AOJu0YwoZMJAaAqBpYebx/kvUjQ0poHHP5FnOZOnY4ZqUyFVZTxxH1c1 QMk0ElZlMG+zBgR+mGQJWdMQ0+YWlnoa19BTJKJJtsIcD1I7+IqBSNlEHahHQ9/5q9dKZoAkpMC NwkCHZmhcA8psUbapvuZDF5xdwOvXO4UmH6sLpxGMu1G7hbn8wTE= X-Google-Smtp-Source: AGHT+IEADc7sDV0+QahEn+TdsngXhPiTEMLJW10KGPzyV1CT+/cvDaOC2t4KNqML6dkxA9SH2+bZYL/U7+nZKaKkv/Q= X-Received: by 2002:a05:6808:10c8:b0:3da:a793:f10e with SMTP id 5614622812f47-3df1b72b77bmr9629701b6e.18.1725362696174; Tue, 03 Sep 2024 04:24:56 -0700 (PDT) Received: from 1064022179695 named unknown by gmailapi.google.com with HTTPREST; Tue, 3 Sep 2024 07:24:55 -0400 Received: from 1064022179695 named unknown by gmailapi.google.com with HTTPREST; Tue, 3 Sep 2024 04:24:52 -0700 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 (Mimestream 1.3.8) Date: Tue, 3 Sep 2024 07:24:55 -0400 Message-ID: Subject: [PHP-DEV] RFC: Deprecate json_encode() on classes marked as non-serializable To: PHP internals Content-Type: multipart/alternative; boundary="0000000000009d5e3c0621354ee6" From: phofstetter@sensational.ch (Philip Hofstetter) --0000000000009d5e3c0621354ee6 Content-Type: text/plain; charset="UTF-8" Hello, As per my previous email to the list, I have now created the official RFC to deprecate calling json_serialize() on instances of classes marked with ZEND_ACC_NOT_SERIALIZABLE. https://wiki.php.net/rfc/deprecate-json_encode-nonserializable I have also created a PR with the implementation here: https://github.com/php/php-src/pull/15724 I have considered other options, both constraining the implementation to just Generator and/or to add special cases for Generator (and maybe Iterator), but they either continue to keep the asymmetry between serialize() and json_encode() and/or are making things even more inconsistent. Please tell me what you think, especially, if you agree that blanked-deprecating all of ZEND_ACC_NOT_SERIALIZABLE classes is acceptable BC-wise (after a bit of deliberation over the weekend, I think it is and most json-serializations of such marked classes are probably unintentional). Thanks in advance for all comments Philip --0000000000009d5e3c0621354ee6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

As per my previous emai= l to the list, I have now created the official RFC to deprecate calling jso= n_serialize() on instances of classes marked with ZEND_ACC_NOT_SERIALIZABLE= .


I have also created a PR with the implementation here:=


I have considered othe= r options, both constraining the implementation to just Generator and/or to= add special cases for Generator (and maybe Iterator), but they either cont= inue to keep the asymmetry between serialize() and json_encode() and/or are= making things even more inconsistent.

Please tell me what you think, especially, if you agree that b= lanked-deprecating all of ZEND_ACC_NOT_SERIALIZABLE classes is acceptable B= C-wise (after a bit of deliberation over the weekend, I think it is and mos= t json-serializations of such marked classes are probably unintentional).

Thanks in advance for all c= omments

Philip


--0000000000009d5e3c0621354ee6--