Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130695 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 lists.php.net (Postfix) with ESMTPS id 56CAA1A00BC for ; Sat, 25 Apr 2026 21:58:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1777154329; bh=EU4+RlGzuNWFvkgjtFwuoo5C+4EGVI6Cr/Qdhb3iOtc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=UeAAX1X7HClN93bVwnm1TLUeXzuy9PJpfZwg+IepH1rUmX8iHeYn80hexp0Kr7Fcm 41JYMU3KK13LmWPIFYLcIVMQEuZ/WJ/eQ/tC/AsB682HVXWCAJ9yzOyOV8E64qN3x9 AtZ9rSZZoWYWjq6rP1FIr0CRN+XQ3ItKvLobMxGbrBac/XoY47ZRIdheKu9QzFahup 3MkiMH3o+JSeuc3kTYorZ5MAoB8sgbDX4Aqu1hldhsGkbXZPYSHQnyiDCkUhZR8pMi hvKorvkaELA9FvSau5YXKF9uqZirYUXHX/qpgRxkB6ld1WtGQo3pLs6b5qbZ5HcoC2 Oh+1WnPQ/fK/Q== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id ECF65180074 for ; Sat, 25 Apr 2026 21:58:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: * X-Spam-Status: No, score=2.0 required=5.0 tests=BAYES_50,DMARC_NONE, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-oo1-f43.google.com (mail-oo1-f43.google.com [209.85.161.43]) (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 ; Sat, 25 Apr 2026 21:58:48 +0000 (UTC) Received: by mail-oo1-f43.google.com with SMTP id 006d021491bc7-691de293326so4996992eaf.3 for ; Sat, 25 Apr 2026 14:58:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1777154323; cv=none; d=google.com; s=arc-20240605; b=eGWhc//ojyJrS5TRmSJe2v0/FyJfKN2npHpNzmQQecRyZPiaSSNxQPPtxjKeRP56NT TvHzxuDdWjW40yP8s4UqOZSyE2UwSqFeckYg61AEpFy00vIBWKxuFamZEnbTe2Ww5o/i ixAApJaIONkEIOyh2Htmqmxip0pZi8vHDBhztFpPbAU/AbgOVjqxq/AmLt+7NE9mVMI4 ZZapt8BviE/GQXgb9gnYZmbLPrxGbkibyB5HuRVF64HfI42D6Z+2SY+z/jb1bWc3+mYZ 5DcyUuLJjVy/o6q3Dfouc9HoLyxf2IIvyWo6sOudzFASAeQtiusV1UX4GFKSAtZ74EsD G3AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version; bh=EU4+RlGzuNWFvkgjtFwuoo5C+4EGVI6Cr/Qdhb3iOtc=; fh=xX59M9k2LJe5CkjPpBTRX27Ve3+5hYeaIKPXnbjUkb8=; b=Z02hS+HosmAYaSDm1AVnEg0gtL0A1PylkwL5+lw3chSn+LugVPnDuEgcAVbNbKaTLa /SaQM7xHvYJEsFQja381JI03iUy1mjlYSkSMeEKgWuWnM9E239i6LHGIKWVLJp7I3ZuQ c9mkVKFetM9mmrcwUlGDo4K2pYptFSnUL3/WGZIfel9CYmvsi/CBdVlKLBvdWKBvY0GU y7Ic3bFYkYAnTu0CorS87UCWjNwaZahBxBlgY5D4tM1damWkIIQnAilLj9+UZHWwwIPJ HUQgjd3kR66QLmGlWu9a8EGtEE9501yfSwZuTBQ1PpmaA5bR0+8BzR6u/5BUWY21qC22 dETQ==; darn=lists.php.net ARC-Authentication-Results: i=1; mx.google.com; arc=none X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777154323; x=1777759123; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=EU4+RlGzuNWFvkgjtFwuoo5C+4EGVI6Cr/Qdhb3iOtc=; b=XaVC7L3fhadjXbny0QN3bgkXDdYnNxn1jYJUJvSdXfibV9ls0sEp463qlpSirv65Xn jtHi4Comhpsl4g5cMVdJ/FjGHvD5Bx7OXMI3+Ld/hPA3oJaX9aUC8kV6Yv+eOVZNJPSi BV2NKcEBiujEA9tslww7kDORPaSrzskjgZCOJx6qMWBwWDyQymqTWpO+JrD9aA94aqZ2 87dVIkEBNa4tL+MrNoWDe3CPJLb+VUJTt4LVnZRS4f+69Orm/1IKUgvOl5AumpuRFJMv 9++2Ju8SwX+1F5miGkb8mYBKLRQf67nz9wnRx2B7CV4dZWIHSc2u+F9zJqRnv5G+K9E6 NmFw== X-Gm-Message-State: AOJu0YztO8XA1Wv67AiN37EKt4c9DcrcbZu22aTLZ/R2SKBvcsffcqUX hnzGv97wd8xd5asZahJpAbi8OFWIZns6VIPOrI613okP0mfrnh3v8HpftLK+JJqQq6Q+hYegn6S 0MD9+XPSv83iy4zA02spAzQttK1rsxC9LFQ== X-Gm-Gg: AeBDies/59fG1czbt996rZDC+Kpjs/8L8i89WyWGHnUJSx8wxlWgSmJxVEVcl6Izcz7 gov7UwW69SZcGJt15IRJbtMjv2y5KurBH+pjeb6+KgJEjvBk9zXmJkDFME5/pcwnIzGTs8olN7D EzZR1jX6QecxR5dQvuJPbr7fnsVL3yIuKwadFXvebYT9f0sw4qzH4TDNoAbG4TtpAjN+2v9K8NT RkIxr5brOK50JMujdtUpjh9SDDB08USdW23fxH92axCEP/EK+qud4Oe47Ugrqb1HkmwbjqfcnrO KOx+DkS/iKtXZ2slWA== X-Received: by 2002:a05:6820:189a:b0:695:a610:eccb with SMTP id 006d021491bc7-695a610ee89mr9625027eaf.20.1777154322852; Sat, 25 Apr 2026 14:58:42 -0700 (PDT) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: <926a26a6-eb89-49aa-a387-6cc79caa29c1@bastelstu.be> In-Reply-To: Date: Sat, 25 Apr 2026 23:58:30 +0200 X-Gm-Features: AVHnY4ImZYaRcZf4YByCTiFKgB_byaOWBfGOfR6oBnJCQrykz4JhPs-fasavWe0 Message-ID: Subject: Re: [PHP-DEV] [RFC] Polling API To: =?UTF-8?Q?Tim_D=C3=BCsterhus?= Cc: PHP internals list Content-Type: multipart/alternative; boundary="0000000000001ff18f06504ffc87" From: bukka@php.net (Jakub Zelenka) --0000000000001ff18f06504ffc87 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, On Tue, Mar 31, 2026 at 3:24=E2=80=AFPM Jakub Zelenka wrote= : > Hi, > > On Tue, Mar 31, 2026 at 11:23=E2=80=AFAM Tim D=C3=BCsterhus wrote: > >> Hi >> >> Sorry for the late feedback, it's hard juggling all the different RFCs >> that are in progress to provide meaningful feedback. >> >> Am 2026-03-11 22:07, schrieb Jakub Zelenka: >> >> > I also think that there is not really much use case for user space = to >> >> > implement their own handles so such interface would be used only >> >> > internally >> >> > anyway. >> >> >> >> This applies equally to interfaces and abstract methods. The abstract >> >> base class however will make it much weirder when a specific (future) >> >> handle might need to implement additional interfaces or abstract >> >> classes. >> >> >> >> > In addition interface would effectively expose the internal stream = fd >> >> > which >> >> > is currently hidden and makes harder messing up with stream fd whic= h >> >> > might >> >> > cause various issues. >> >> >> >> I don't understand that point. For both an interface and an abstract >> >> method, the method would exist on the child class and thus can be >> >> called >> >> by a developer. >> >> >> >> >> > Well if it is abstract, then the method can be protected and because >> > the >> > classes are final, user spaces cannot call it. But for interface I >> > would >> >> Protected methods of internal classes should still be accessible to >> Reflection. >> >> > Good point. > > >> > need to make it public which means that StreamHandle would need to >> > expose >> > callabable (public) method. I know that I could just return 0 and use >> > different handling internally but I think this would be surprising and >> > created obvious inconsistency. I mean it's fine if the calls happen >> > internally but if the exposed methods are just dummy and return >> > nonsense >> > for user space, then I don't think it would be a good design. >> >> It's equally weird that there is a protected method that is effectively >> internally called by an unrelated class (Context) that is not supposed >> to know about it. Perhaps the correct solution would then be removing >> the `getFileDescriptor()` method from the public API entirely and change >> `Handle` to be an empty =E2=80=9Cmarker interface=E2=80=9D that cannot b= e implemented in >> userland (similarly to Throwable) to leave all options open for the >> future? >> >> > This (marker interface just for internal classes) is actually a really > good idea. Will change it. > > I just implemented this and it's much better so thanks for this. RFC updated as well. --0000000000001ff18f06504ffc87 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

On Tue, Mar 31, 2026 at 3:24= =E2=80=AFPM Jakub Zelenka <bukka@php.ne= t> wrote:
Hi,

On Tue, Mar 31, 2026 at 11:23=E2=80=AFAM Tim D=C3= =BCsterhus <tim@ba= stelstu.be> wrote:
Hi

Sorry for the late feedback, it's hard juggling all the different RFCs =
that are in progress to provide meaningful feedback.

Am 2026-03-11 22:07, schrieb Jakub Zelenka:
>> > I also think that there is not really much use case for user = space to
>> > implement their own handles so such interface would be used o= nly
>> > internally
>> > anyway.
>>
>> This applies equally to interfaces and abstract methods. The abstr= act
>> base class however will make it much weirder when a specific (futu= re)
>> handle might need to implement additional interfaces or abstract >> classes.
>>
>> > In addition interface would effectively expose the internal s= tream fd
>> > which
>> > is currently hidden and makes harder messing up with stream f= d which
>> > might
>> > cause various issues.
>>
>> I don't understand that point. For both an interface and an ab= stract
>> method, the method would exist on the child class and thus can be =
>> called
>> by a developer.
>>
>>
> Well if it is abstract, then the method can be protected and because <= br> > the
> classes are final, user spaces cannot call it. But for interface I > would

Protected methods of internal classes should still be accessible to
Reflection.


Good point.
=C2=A0
> need to make it public which means that StreamHandle would need to > expose
> callabable (public) method. I know that I could just return 0 and use<= br> > different handling internally but I think this would be surprising and=
> created obvious inconsistency. I mean it's fine if the calls happe= n
> internally but if the exposed methods are just dummy and return
> nonsense
> for user space, then I don't think it would be a good design.

It's equally weird that there is a protected method that is effectively=
internally called by an unrelated class (Context) that is not supposed
to know about it. Perhaps the correct solution would then be removing
the `getFileDescriptor()` method from the public API entirely and change `Handle` to be an empty =E2=80=9Cmarker interface=E2=80=9D that cannot be i= mplemented in
userland (similarly to Throwable) to leave all options open for the
future?


This (marker interface just for intern= al classes) is actually a really good idea. Will change it.

<= /div>

I just implemented this a= nd it's much better so thanks for this. RFC updated as well.=C2=A0
--0000000000001ff18f06504ffc87--