Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124357 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 BAA2C1A00B7 for ; Wed, 10 Jul 2024 17:44:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1720633536; bh=/DQrjjer1y1Ub4BQUQ05c5wbV7fbVTqfI7sCV7u2JaA=; h=Date:To:From:Cc:Subject:In-Reply-To:References:From; b=QZX3tbW9Z2w3UeJziEs1scGmxxKFlrBpY23Qa5PtNVztuchXqtxmPXv34kQ/pHMyM 6x4sBTV9neJh4i9zZWH699M+IOCuHUJMZa1EZh2hjD2Z9i7cX5No88i9y08IZVflI3 RAlcwB5Zp7Ih3r/FBMqd+O4BJX3GDxdALFGZy7I6KlS3D5Qzwbicl3vV076DrA4n3P MGdH3TUowJer8+ykDe7tY8VVNTSoRlzpYr24VYAVNBiAR0AgyJMz+Edr2L4ZJrPv/B CpZUzecUDtAMW7AGlInTfgDghxtwTIM+MmHx5BpAVZE6UXSMA5Tc/KtmrIbW5lfDjX dh2mgMKUITX0Q== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E11BC180072 for ; Wed, 10 Jul 2024 17:45:34 +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_PASS,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-40136.proton.ch (mail-40136.proton.ch [185.70.40.136]) (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, 10 Jul 2024 17:45:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gpb.moe; s=protonmail2; t=1720633445; x=1720892645; bh=/DQrjjer1y1Ub4BQUQ05c5wbV7fbVTqfI7sCV7u2JaA=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=Qfog+/14VKDxp/9v9EpDlww4J2xVyIZdIz0CX8Sb/r6lkeAgHCoIz1iNd9QHiemYj sxRLLLeo/NEqLp3u87vT0jg0tCWpgZfYThRAJix5bF+4Z57aEoWwLcVLoEZicDXWDn S3nGqW0xOg3LYeFf1eKHjZswUQSOsFOZ55IA47HRAIU5AkOiQLAjWGA3wkOSw4I/b7 OoHnEuHjGL27RLpo6jCtI5P6lsTSd03rOlgF+4IsU5oW+cBHpdXtjubwfsOK+6K6fs V85oRvvrEfK7pS6FYMLMUOD2xg31hrqwB05Jjp71bEkjuLKH7WAzcVq0B1hAdYe2JA r4w7OsuH/rotQ== Date: Wed, 10 Jul 2024 17:43:59 +0000 To: Levi Morrison Cc: PHP internals Subject: Re: [PHP-DEV] [RFC] Improve language coherence for the behaviour of offsets and containers Message-ID: In-Reply-To: References: Feedback-ID: 96993444:user:proton X-Pm-Message-ID: da31468f6fbda29de8120b5eb44f59bb55db746c Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: internals@gpb.moe ("Gina P. Banyard") On Wednesday, 10 July 2024 at 16:22, Levi Morrison wrote: > > Everything considered, I still do not think changing the name of the ap= pend() method is a good idea, will it hurt adoption in the short term for s= ome classes, yes, but I prefer this than having a large part of the ecosyst= em needing to create an alias just for some weird cases. >=20 >=20 > I don't fully understand the issue with aliases. Could you elaborate > on that? Would calling the method instead of direct aliasing avoid > whatever the issue is? I don't think this would solve the issue, as it is not required for a child= class that extends said method to call the parent. Let's use a class that extends SplObjectStorage as an example: https://3v4l= .org/l913b Our custom class overwrites the behaviour of the contains() method without = calling the parent method. As such, the behaviour of isset() becomes incorrect. And even if we make offsetExists() call the contains() method, nothing actu= ally prevents the child class from overwriting the offsetExists() method in= stead of the contains() one. In which case, the contains() method would still be the original SplObjectS= torage one. One could also just extend both methods and have them differ in implementat= ions. I really believe there isn't a good way to solve this problem other than no= t having any aliases within class methods. Best regards, Gina P. Banyard