Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122094 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 8638 invoked from network); 3 Jan 2024 13:17:33 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Jan 2024 13:17:33 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1704287884; bh=A2fNVf5LgDy7vBIqFLqu9+psXOBsFzGEQwtDjM3dZfU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=LjVYoGtl6AKQ7Rm6DnkQgB8Md1CQJBRnywYOmVRycKx9Kf10CtDxHockxvZa27HEP esjsPhhf3jYrooeXICHbSP8sBuCuQAA076y+6aSVypMPF+MtjO4CIvHY8VrK+NAWoq nL29JkQZUgJPAWDVfcgZmEIr34NhAdz8nlGGMoJjPqoFeTEd023Z9BeS8hwI3lo/KE 7scH7zlZsGezCk1ULNrIoLelaugve5A7Pa9s1XvDziLkwWHUf2a2JChD3WVEITCVmA 9dX/l87Sw3fhw5YheCLrvevxijMJgFgslDUDgAh8kuSWf2Bg4LcSUe2ZWmbKI4U4wb /3A7xFG9mlXzw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4AFAD180058 for ; Wed, 3 Jan 2024 05:18:03 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, FREEMAIL_REPLY,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-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) (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 ; Wed, 3 Jan 2024 05:18:02 -0800 (PST) Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-556aa7fe765so1382657a12.2 for ; Wed, 03 Jan 2024 05:17:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704287851; x=1704892651; 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=grMjZwTrzfS2bhgePT4w0z8cUDL6Vl9959Ame7LdQ0o=; b=VSod2B5HyM31vr4qIoel5krAUZ+0F7xmIkVtkyLoW2cR5P2Z6YcAsL1OzAfiDOjNVf sSmj55cbmP8I7VgXAXAsfD4t5NH61JyNULGYD/eG8DCcem/Ui7Xk3QqHNdkSFPA0j1Tm wjaZmRqlIYAy6Hr0cTa0y7QPgPoGhsXU1Y0LfVV+Amt+ULfSDadE4H7GJkUfXxMZEqkL ou/DYz02Vjhye7japUmbCZRtC3xEn253CTlYGC1MGLQJhmKLQXmV32IqM2+FQmakqn0i jcfQ3r/vK1EUklmcV+iOC9PU46zZ488mRyCavRdfRAkiZAEI7wU4FbfqAObFIe6h+Th6 iuvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704287851; x=1704892651; 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=grMjZwTrzfS2bhgePT4w0z8cUDL6Vl9959Ame7LdQ0o=; b=eNM2pWEivmxOUqFAuUqn2amp0sCzxGfgy7nhkG4yAnWHQ1YQ12rUKP7Sagn3KH8/iY lfM/QDXBvNaC0OXio66Zrlmzran5sjQoanKL4P69G0tkRrSE0ATeQSReau02s+blcRHc a+dkiTg6IuCCyUgRg62q3BmRZd33BitJFy7AVGwGO52t51GOS+5h7raM4bsidOXLB1y2 dRWWDWcq4QQuSd6rmDDvQz9pQyp+iMg3SJ8nibsbxy5JtILfEl0MEQpqP5oGIjbQ6Rw6 AnASFaHM5pYlfS9T9gX2tP/C81rjO4FTxaL/sMTOeewhBzxf/EG5D/CItG0ENznP7cvG j6cg== X-Gm-Message-State: AOJu0YzhYlDKyIj2qFQAgEUMhX62VAB0bm3OnGAc6Hx8N+kvY/lfF9qT DngUB9av/d3eqe4AIiQ1JXM8r8tDFfFTGQTRD20UAmjCkWw= X-Google-Smtp-Source: AGHT+IGuxe903nSp7wXclnrtTs4GfdGM1sdXqHJzknSItexp6gsCjPL816NJSpQ88mnOYSUK/ZfEa1HcMC06Gjouhlg= X-Received: by 2002:a17:907:20ae:b0:a28:77ec:a703 with SMTP id pw14-20020a17090720ae00b00a2877eca703mr719405ejb.78.1704287850465; Wed, 03 Jan 2024 05:17:30 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 3 Jan 2024 16:17:19 +0300 Message-ID: To: Nicolas Grekas Cc: Internals Content-Type: multipart/alternative; boundary="000000000000ec0eb0060e0a6f59" Subject: Re: [PHP-DEV] [RFC][Discussion] NotSerializable attribute From: maxsem.wiki@gmail.com (Max Semenik) --000000000000ec0eb0060e0a6f59 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jan 3, 2024 at 10:11=E2=80=AFAM Nicolas Grekas wrote: > > Regarding the inheritance-related behavior ("The non-serializable flag is > inherited by descendants"), this is very unlike any other attributes, and > this actively prevents writing a child class that'd make a parent > serializable if it wants to. > > To me, if this is really the behavior we want, then the attribute should > be replaced by a maker interface. > Then, a simple "instanceof NotSerializable" would be enough instead of > adding yet another method to ReflectionClass. > As explained in the RFC, this implementation hooks to the already existing feature. Additionally, checking a bit in zend_class_entry::ce_flags is much faster than checking inheritance. > this actively prevents writing a child class that'd make a parent serializable if it wants to. Wouldn't this violate LSP? --=20 Best regards, Max Semenik --000000000000ec0eb0060e0a6f59--