Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125454 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 817751A00BD for ; Fri, 6 Sep 2024 18:10:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1725646366; bh=7wtTQdlhq4hVZhGthl+iFW+D4W7ON+qWtpyMh+N3WB8=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From; b=EakCxZjt2Np+MRX80jWYfZPm+OJmD8LDuV7WLjVmzSalowdZtSrSv4ArBVj6xO4H+ X5LAYQu3RJLmnwt5D9TzbneTd3alCt0aV9Ycyuz2MCodxeT/8z95X76DXWqJguNJx/ aQwmYsdXlcqoVtYcqKSsuhhZrd5pv7udMwe6k9EXwz2QT/nU+FxEhnKgypUdGTSfGs wrqYRQxIFspxVtp+fCALzH1KxzAl0NOdZcPuOXZ63e3CImySLt7zeyvU0RNGgIrPxE tUi2ZyJ2HX4+g7qwcnIrqq1pDSfFXlhDaZExrZAu+Ka4F5rbkQMb35dNdATh0YUVlP SdZ2Ykx5eV37g== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C89BC18007E for ; Fri, 6 Sep 2024 18:12:43 +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.8 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DMARC_MISSING,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) (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, 6 Sep 2024 18:12:41 +0000 (UTC) Received: by mail-qk1-f176.google.com with SMTP id af79cd13be357-7a9782651bdso285195885a.1 for ; Fri, 06 Sep 2024 11:10:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=coggenterprises-com.20230601.gappssmtp.com; s=20230601; t=1725646242; x=1726251042; darn=lists.php.net; h=mime-version:subject:references:in-reply-to:message-id:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=7wtTQdlhq4hVZhGthl+iFW+D4W7ON+qWtpyMh+N3WB8=; b=v4/lOk/geBLAXK8vTRAczS+BY3su5vQb/EqLX0AnZPhtl8oBurX8aaX3FFSpMx+Ijg isVUSnQAwanK3PEEZvw7JQaHu9DPRbESHu+1gX299QuhC3eMV9rqeyeFHUrB0D/Ig4qM RtOstKnZEp5mUq1pInKB/EvQvvsuLUFcHiriJ/LxkYlZttQAPNz99x4tdN3s3/osk4V+ Z7osSFjuUOMkg3D7iRNiJCEn3KG9QSy5E6wzQhN2+YGutlVhQu2MFMf/aM3z2FEGCGug MgjYMlW1kAYWjuYlr1yMYD65w9nv0MYgPWwDsTbzuzaevIYVe/H/BcFj1X+kSWz5mYRA puYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725646242; x=1726251042; h=mime-version:subject:references:in-reply-to:message-id:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7wtTQdlhq4hVZhGthl+iFW+D4W7ON+qWtpyMh+N3WB8=; b=xMP5cwzE2ZEayru37c7yuw+7Uivx8YbPQxdI3HgvD9cERLpuxxnEEtERC7ij4+JePW UIwa3tcTFgON9HoMj4L6tHQMC9krcrd3Q318mzIh6L4/Ml347mwTPzrssIvzHFsgkUaC GDwiaox3zE7yElkx3qVFL/bQxCKZ7ozd0DpMC0BB9kKJg7Frkp6rbYxgSECrjy+Vay91 phNxZTSW+UN96va8EtPjJcCLagoRi3sF/Wc6NiG2vtOkpW0hAGFW8D0hYGSdTFLMTJLA owH4RfGvZ1SaUW29q6GI6e9TRBQ7UGpN9ImXv3w0R3UPzEPUKiReVIGmc8FQLNusVc7x kFnQ== X-Forwarded-Encrypted: i=1; AJvYcCVy5zo9guAYWvKQ74JJH3Yj9Asj1njG/oTE9FSi/0iXDOx9HpoBi9Lakn0/8Cr91siu/0aQ6LGUMUk=@lists.php.net X-Gm-Message-State: AOJu0YyPdf3tSXhR0VC7XIzqv2osTIxp5ohpxArAYE/VvXrlSlZ6Du+j VNLOfUNubFlxboTZgH2NF6L18vmU8LNYhCk1ijzWVDlP2xfCfUuE3vKjXddwbAcLlPB6elCc/4M u X-Google-Smtp-Source: AGHT+IFt/V2aBDBzHW9RZicVIVfJSP/6Fl+Ox/kJ97C5e95Q4bthVhr0vr1rHP79GzxYndVdKKuRiw== X-Received: by 2002:a05:620a:170a:b0:79f:1352:8318 with SMTP id af79cd13be357-7a996ba80camr709646085a.4.1725646241763; Fri, 06 Sep 2024 11:10:41 -0700 (PDT) Received: from Johns-MacBook-Pro-2.local ([98.97.18.57]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7a98ef380c3sm192075085a.39.2024.09.06.11.10.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Sep 2024 11:10:41 -0700 (PDT) Date: Fri, 6 Sep 2024 14:10:40 -0400 To: Claude Pache Cc: Philip Hofstetter , PHP internals Message-ID: <2ED0D37F-3DB9-48BF-8C32-C4A036E71089@getmailspring.com> In-Reply-To: References: Subject: Re: [PHP-DEV] RFC: Deprecate json_encode() on classes marked as non-serializable X-Mailer: Mailspring Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="66db45a0_6b8b4567_7e04" From: john@coggeshall.org (John Coggeshall) --66db45a0_6b8b4567_7e04 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Sep 6 2024, at 2:07 pm, Claude Pache wrote:= > > > > Le 5 sept. 2024 =C3=A0 18:03, John Coggeshall = a =C3=A9crit : > > > > > As per my previous email to the list, I have now created the offici= al R=46C to deprecate calling json=5Fserialize() on instances of classes = marked with ZEND=5FACC=5FNOT=5FSERIALIZABLE. > > > > I would suggest we take a step back from this and look at it with a b= it more of a wider lens. It seems to me that this would be a good place t= o have an attribute (e.g. =23=5BNotSerializable=5D ) that could be define= d for any class (with ZEND=5FACC=5FNOT=5FSERIALIZABLE being automatically= given this attribute)=3F It just seems to be a more holistic approach th= at makes sense, rather than basing it on internal engine stuff and/or lim= iting it to internal objects. > > Coogle > > > > Hi, > > An attribute adds very little value. It doesn=E2=80=99t add new capabil= ity, because you can achieve the same effect with a serialiser that throw= s unconditionally; it is just a nicer syntax. People generally don=E2=80=99= t bother making their classes unserialisable unless they have a good reas= on; having an attribute won=E2=80=99t really change that. There are plenty of examples in frameworks, etc. where userspace classes = are defined that simply shouldn't be serialized for a variety of reasons.= It seems odd to me to have the notion internally within the engine that = a class can be flagged as not serializable, but yet not expose that same = ability to userspace. Coogle --66db45a0_6b8b4567_7e04 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline

On Sep 6 2024, at = 2:07 pm, Claude Pache <claude.pache=40gmail.com> wrote:


Le 5 sept. 2024 =C3=A0 18:03, John Co= ggeshall <john=40coggeshall.org> a =C3=A9crit :


<= blockquote>
As per my = previous email to the list, I have now created the official R=46C to depr= ecate calling json=5Fserialize() on instances of classes marked with ZEND= =5FACC=5FNOT=5FSERIALIZABLE.

I would suggest we take a= step back from this and look at it with a bit more of a wider lens. It s= eems to me that this would be a good place to have an attribute (e.g. =23=5BNotSerializable=5D )  that could be defined for= any class (with ZEND=5FACC=5FNOT=5FSERIALIZABLE  being= automatically given this attribute)=3F It just seems to be a more holist= ic approach that makes sense, rather than basing it on internal engine st= uff and/or limiting it to internal objects.

Coogle


Hi,
An attribute adds very little value. It doesn=E2=80=99t add = new capability, because you can achieve the same effect with a serialiser= that throws unconditionally; it is just a nicer syntax. People generally= don=E2=80=99t bother making their classes unserialisable unless they hav= e a good reason; having an attribute won=E2=80=99t really change that.
There are plenty of examples in frameworks, etc.= where userspace classes are defined that simply shouldn't be serialized = for a variety of reasons. It seems odd to me to have the notion internall= y within the engine that a class can be flagged as not serializable, but = yet not expose that same ability to userspace.

Coogle
--66db45a0_6b8b4567_7e04--