Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125433 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 CCD8A1A00BD for ; Thu, 5 Sep 2024 08:23:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1725524757; bh=yncOX0YvbGk9+sGr+9kx4MGEtjjahr3dUbw9teaDREo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=GC3Us0iNy7ikz2HqTYE7lDYQxIOUPQJFDEinbB9AsoE/beO+iZkmS7zLtQSRtcD2b PqVt08DpJLij5qDg5Q6SK5tt8RPmzxm3kJKuOTvH9Y87gb+uo49iQ/rBkOK6HKA8aC 62sYOa88swnlssLd7eCFQHmWJY1vDcPopo/ViOQWEtNjj4qgDGpASZ/IzWyOBo01eS bqAnrHIbBic0onUVJkMGtdaphruSKw5wef/0ZltX86W/xB42lHHNYn9Rc1JzBx7XE6 1a2gcw8yNl08TSmofw1U1+ivY5gdIwKadqNXs39m+vt9Roy7mEJoU/50Al7NdY1a1J t22xeMpCTPGDQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 46060180052 for ; Thu, 5 Sep 2024 08:25:56 +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-f179.google.com (mail-oi1-f179.google.com [209.85.167.179]) (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 ; Thu, 5 Sep 2024 08:25:55 +0000 (UTC) Received: by mail-oi1-f179.google.com with SMTP id 5614622812f47-3df094394daso255894b6e.3 for ; Thu, 05 Sep 2024 01:23:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sensational.ch; s=google; t=1725524636; x=1726129436; 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=nveo0SR7iPoz5pwjPQaCpnN4RHua9h+GVicQZToNhwQ=; b=LQt7ruP10jZuI5V9V9prgY7K4kfki5yeBRVmvL+2nll1TVBc1koP5MPyTCAh+YkKg9 /wZ4oMB6trj/9ZEkRd21TEmM/PgTvOVDlSAq6INPmeTWNSUQqpelXVe/55egIzTtwDXk CEnv+vF6G6yHdvXePPyGh2u30MEf5qQdNviyVhApMM7uQnAkKqr7269YL5D+vkp5u5/9 h9my1KtFLDM+MTwZRSjJO1pDgf+kHHcSAIen68vZyPPGLLB7mJswjlEJNnBGNmQGiNTf ikwecpi17PHAP+RLkOGSpGD8PE4EaiJ8oiQxhGCcvb2eUrHftpd6d8G+I0zQfMzCLIjN KrBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725524636; x=1726129436; 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=nveo0SR7iPoz5pwjPQaCpnN4RHua9h+GVicQZToNhwQ=; b=gBajrmZb8y11C7dpUvD1KBLBfNduRLqTCPSQkHIg9C9SOITRPb43lOQMFAxvQC43lf dFxemS3zq+XxNmqZa7cVSKpI1yy6vsRbRQHqnuAJC8czKzMHQ97AK8OO8EhrXEwWqjWD kG45q0RjFFUchWmprCvjmu24vDvwMqSVQ6/Kka6gMwignXhyPO7YAeXzKA6xn6IEZImU dW3k+pdpb26HHpcfBogzeAKbLum9VNCSUHbes2iAyGuGdOeKpefUU+P7P7CTZuCj8Hjy S0mFNxDNBvn6AbuJnSKPuE0piNa7ZFykdC6Bm8zFh2EI5TvuGpMr8CKRABMW4XQgVitt Z1vw== X-Gm-Message-State: AOJu0Yzpk2O29NgWkvJJKUIngDBqKQppf8txEbx+pJCzQKw59TZD+Kig 49ONSXAx+Z4Yb41gZWjiwNU7owVvLqiTEGEIZioCHwC+dgjuiPOau4u8u66oHjvi/9R1+iquwv6 iRG0VtAgcElNZbCs6NjLIRH5d8+UDCBidXvcAXpbL81gcocKh X-Google-Smtp-Source: AGHT+IFEWGeMLgQ+PVeDtxECUhe8ZJRlc2IA/Vngb0/5jslMnmtf2f8GiDXss25++Vqod2z/YQ/6LDmkkTiKrM0Un5w= X-Received: by 2002:a05:6808:302c:b0:3df:1d5e:b34 with SMTP id 5614622812f47-3df22e2c053mr14708082b6e.46.1725524636667; Thu, 05 Sep 2024 01:23:56 -0700 (PDT) Received: from 1064022179695 named unknown by gmailapi.google.com with HTTPREST; Thu, 5 Sep 2024 03:23:56 -0500 Received: from 1064022179695 named unknown by gmailapi.google.com with HTTPREST; Thu, 5 Sep 2024 03:23:52 -0500 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 (Mimestream 1.3.8) References: In-Reply-To: Date: Thu, 5 Sep 2024 03:23:56 -0500 Message-ID: Subject: Re: [PHP-DEV] RFC: Deprecate json_encode() on classes marked as non-serializable To: Rob Landers Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000052af506215b037f" From: phofstetter@sensational.ch (Philip Hofstetter) --000000000000052af506215b037f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello Rob, I think it would be good to list these non-serializable objects in the RFC. > It doesn't have to be exhaustive, but the list includes throwables, > weak-maps, weak-references, closures, fibers, etc. Some people may be > relying on this behavior (and I'd be curious to know that use case myself= ). > Thank you for your note. As I went through to the code-base in order to compile the list for the RFC, it also occurred to me that all anonymous classes are marked as ZEND_ACC_NOT_SERIALIZABLE, but json_encode()-ing such classes is unproblematic and probably very much desired for user land classes. I have updated the RFC and attached implementation to allow anonymous classes to be json_encode()=E2=80=99d, provided their parent class is not m= arked as ZEND_ACC_NOT_SERIALIZABLE. Thank you very much Philip --000000000000052af506215b037f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello Rob,


I think it would be good to list these non-serializabl= e objects in the RFC. It doesn't have to be exhaustive, but the list in= cludes throwables, weak-maps, weak-references, closures, fibers, etc. Some = people may be relying on this behavior (and I'd be curious to know that= use case myself).

Thank you for your no= te. As I went through to the code-base in order to compile the list for the= RFC, it also occurred to me that all anonymous classes are marked as ZEND_= ACC_NOT_SERIALIZABLE, but json_encode()-ing such classes is unproblematic a= nd probably very much desired for user land classes.

I ha= ve updated the RFC and attached implementation to allow anonymous classes t= o be json_encode()=E2=80=99d, provided their parent class is not marked as = ZEND_ACC_NOT_SERIALIZABLE.

=
Thank you very much

Philip
--000000000000052af506215b037f--