Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123434 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 4F59F1A009C for ; Mon, 27 May 2024 11:21:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1716808967; bh=pNw7eKwJDmmZ43oO91zOcpZ9wBqdtAH7HbmlcoUjc2g=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=HJ67mXm0Y3KS2qyD1+NMtvrylw+KnKRk3NzDO4idZGHubir6v1cfAG5SmeHcuQpdJ 8rcpBi321YjJq4S5SxA3h2pUyCoYEtIFbpq51OiwtdhELtenb2OzK0/+lAgCjqMTU2 +yme9Nuk8Rk0wh2ah0DC2KqUE9Wp0bu0tshEIXFnd5yiUA+TX+7IHiOc6VdtGUX2Xu +LSkNx/k5o41sOqKR1clj4vxKIAN785XknxZp54XPj9mHKuWF1qoCJSeLuoA7EG1er KSxUcFaGOXZahFbLOj3W7Sy6hXzJEuC9DxjgmeG+DTmz6SNtd2IpdivqL3QDKuoz1A T1LyaKoTg76Qw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 71829180039 for ; Mon, 27 May 2024 11:22:46 +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,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-yb1-f178.google.com (mail-yb1-f178.google.com [209.85.219.178]) (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 ; Mon, 27 May 2024 11:22:42 +0000 (UTC) Received: by mail-yb1-f178.google.com with SMTP id 3f1490d57ef6-df771fa2b8bso3030424276.2 for ; Mon, 27 May 2024 04:21:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716808903; x=1717413703; 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=pNw7eKwJDmmZ43oO91zOcpZ9wBqdtAH7HbmlcoUjc2g=; b=U7BFfAfbmTbNJUvuStkVAr/1BVXWDcspjv2gLNen31L231HLQfqqzof/2CE1Fg825w 6z9NO/TEVgZ3SwgrWIc1u54CY1jKCYwOq8SmCb6zotu53RifaYIkEn4agXjbI4+4EIGk JiLzX6yD2rVEJfgeOy3xsYNsOw1rYUnJp7KjzXoFgnCabrbhoaKiSY7W7Osv8C9v5Er2 HnYVrP20GBRgrR8HOul/39CwwgwCivmo3tcS1AUVPCnqImBjU74HMNM8ybss6aTaV1mM C537Iy4IpuaXcIxX2d7D/8M4hy0OEyVZJaAZ+6yRnSOb6a8yX0ns2TQsRGizIk3Zoe52 Zl4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716808903; x=1717413703; 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=pNw7eKwJDmmZ43oO91zOcpZ9wBqdtAH7HbmlcoUjc2g=; b=Umv7Bbx87C3B1wjrIocVVVCrBAtmV5B347KEVdnC5+dhpOqQL43U7uZfU05yzY/OyL sCmzqLTkqAN/aIjR/LWoXMWpkpiR708+XDVOFwF+LfgSm2v/r1MYCgyD61jXNtJSKMhf YoGrCpcj4A5bkuGn0eGOzOyiqGVAOFOD5D809JxVmWzNzNCeEZMHXYqogbCAoU467So8 wipFlYqmQv7Q9EkAK0SYebyV2Oju/9FuwR2mVGWrNB408iIg6ol+dfTm0O3R67L0/wHX hJjEK1u1CA0EY13OWcxevLlD6H/9LmHqJ06FplIfRn6MrqklnCfM52MBWTIozLL0LrF+ uLOw== X-Gm-Message-State: AOJu0Yxs6Ev0ikYKAPsV7pBE9BgVyCpU30pp2zq+3Um+hIGlwlq2K0KA t9ckL1gvSC6DXGxN0flvsWFaFrbz+m8YO2fXQ8eq0On6Gs1AT2frIZeJ/qovLXdTK2OUcqy9zFG thc8eCpb91AvaPQ3Z/SBKXm1cXm4= X-Google-Smtp-Source: AGHT+IEHFjkCGUXf688vFXiRs+ym5uwPJhRLSbeY8ogyr2PuNmXkXh9u4R7pg5n0IpZqE/0ji9wMIZX0FDDiKnjhiQw= X-Received: by 2002:a25:6991:0:b0:df2:7c9a:d1d8 with SMTP id 3f1490d57ef6-df77218ab81mr8441671276.17.1716808902854; Mon, 27 May 2024 04:21:42 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 27 May 2024 14:21:23 +0300 Message-ID: Subject: Re: [PHP-DEV] Extract ArrayAccessRead from ArrayAccess To: Valentin Udaltsov Cc: php internals Content-Type: multipart/alternative; boundary="000000000000cd4e6e06196db8ec" From: drealecs@gmail.com (=?UTF-8?Q?Alexandru_P=C4=83tr=C4=83nescu?=) --000000000000cd4e6e06196db8ec Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, May 27, 2024 at 7:16=E2=80=AFAM Valentin Udaltsov < udaltsov.valentin@gmail.com> wrote: > Hello, internals! > > Here's the idea: let's extract `ArrayAccess::offsetExists` and > `ArrayAccess::offsetGet` methods into a separate `ArrayAccessRead` > interface (name can be different) and allow read operations `$exists =3D > isset($object['key'])` and `$value =3D $object['key']` for objects of cla= sses > that implement this interface. `ArrayAccess` will then extend > `ArrayAccessRead` and add the remaining 2 methods. Looks like this change > should not break backward compatibility. > > Please check this: https://externals.io/message/122609#122609 where Gina analyzed and proposed a solution for this. It looks like the DimensionReadable is exactly the same thing. Maybe also DimensionFetchable if you consider returning by reference. Maybe the improvement can be done in smaller incremental steps, but I think it's better to agree on a complete solution for splitting ArrayAccess. Regards, Alex --000000000000cd4e6e06196db8ec Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Mon, May 27, 2024 at 7:16=E2=80=AFAM V= alentin Udaltsov <udaltsov.valentin@gmail.com> wrote:
Hello, internals!
Here's the idea: let's extract `ArrayAccess::offsetExist= s` and `ArrayAccess::offsetGet` methods into a separate `ArrayAccessRead` i= nterface (name can be different) and allow read operations `$exists =3D iss= et($object['key'])` and `$value =3D $object['key']` for obj= ects of classes that implement this interface. `ArrayAccess` will then exte= nd `ArrayAccessRead` and add the remaining 2 methods. Looks like this chang= e should not break backward compatibility.


Please check this:=C2=A0https://externals.io/m= essage/122609#122609=C2=A0where Gina analyzed and proposed a solution f= or this.
It looks like the=C2=A0DimensionReadable=C2=A0is exactly the same thi= ng. Maybe also=C2=A0= DimensionFetchable=C2=A0if you consider returning by reference.
<= /div>

Maybe the improvement can be done in smaller incre= mental steps, but I think it's better to agree on a complete solution f= or splitting=C2=A0ArrayAccess.

Regards,
= Alex
--000000000000cd4e6e06196db8ec--