Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130518 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 F164A1A00BC for ; Tue, 31 Mar 2026 13:25:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1774963506; bh=94pY/4cFj8ASCRGDEt19uNLQ8L+QVeiNTMygCAFEqGg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=hKmfDs4FxQmJSTexBtP4BiTvjGzZZ6/F/Rxl7XDa/c/2EF7dEAxkIljeXasGd+fpP teT91MXq+zQJ5BPYeuVUll/Pra6SorqyeJMDxlzyEKzhRjivLqEq+iW0BbQOZScKSF z5HosLV/b1oq3m8KWHTK5HtvHlaXvZX/4Pzn88lDPaWMUKbyFVcXlKZhyM61/Tm3Ow Fv+27Aq+MFOxRPzZJ3aOAFWes9jRyJv282qnjFoyIj0jlpaHiH0aQE040KX0aw/GFa jY2Eh+qEctf1arAC8fdRFUHgc5X6EYTcCczxGc+R2QbFYkFttckNEsXKYO88id4zhg ymAMUmCySNISw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9FF6A1805AC for ; Tue, 31 Mar 2026 13:25:04 +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=1.7 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_50, DMARC_NONE,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.179]) (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 ; Tue, 31 Mar 2026 13:25:02 +0000 (UTC) Received: by mail-oi1-f179.google.com with SMTP id 5614622812f47-46702742c99so3691380b6e.3 for ; Tue, 31 Mar 2026 06:24:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774963496; cv=none; d=google.com; s=arc-20240605; b=IEaKFp3kiozPNEc23zgNxwQxjAPTT+cfzv7uAyz+FGaW7aH5Vg7ONmP0mCgmPDu1CB oHBUvP2QIw8g7jJzZl/llqBiCKt6RkwZEpO+L1GJnt/aSUqkEzYl516SB7N5FChFoBon 1+aNer/T6VVroqe6zGQzuxyKBqfsxi8rdJDyNAGrQtKzi53j8lJWH8aEOuwWHDSeOEtD H61xUZkfRjcVNslXNIQiCC249r6niQbtY2YAJlkeAeEl3BCuGAMoRZ+1XWTqZiXwDSBn m25Er2Tm103M9luQxTFrW+h3t3VMfeGXzX7UGvHlZNMYZPTy+2P8gN07A0DByolE7Wsp binA== 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=94pY/4cFj8ASCRGDEt19uNLQ8L+QVeiNTMygCAFEqGg=; fh=xX59M9k2LJe5CkjPpBTRX27Ve3+5hYeaIKPXnbjUkb8=; b=UgOocqPxG+cIH3m5kH4GE1u8IWjq2zndetBLiB9h9hHuT444pG8syvfomxZ7iDLqNm T/Xr1uF7zHIweJ/JvfL1zdqxVhhp4SaGCmaYGRLA7R5vZD0D65PNINaHfAP5uuP55m3y L2CFXrc+6yZhENgmpxgaYF80g1zI+sp3WxD1Clwl6K3XVCVgduKWWmi6QsNX8kpR+ImH MtULpwzozptRtSgjMBGaaMzyvZNIC+Y/yiIjX8cny27V39S9RVNSrCe6dqRwR+RyfG/L Gija7jnlTJD+V08xHh0vrtZzuv2T58cWdLTH8PJ01AzFGzFOpOZVdN4s02AvmWKuC9iJ 5ayA==; 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=1774963496; x=1775568296; 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=94pY/4cFj8ASCRGDEt19uNLQ8L+QVeiNTMygCAFEqGg=; b=mm2AT0v7wt0EfzgnnNEjaARxoKMsRcmBHsUG+Ls8X5pEafZMZ5EtAGQSyOuAYE5wUp b6wpLjY+GrvZsuo/yoke7O14IZukf/elSHidH6nfIUrVl6oi0YUVK2gkGHaId+j6csBQ 9O7HLrcFjiVCaAid2NkI3nfbMC1ObW6n/j6pekVaygXRpgP2z0k7jwlfhyIsSTmOewDk fCrPgLC7i/ytVKjUMojRJ75MTGXKGYEieB/9elE8mFsI/cgK9NviJJFnHqgOqag6Gzl+ 15PeRwRxdjR6Vd/i+V1G6yQbsxs1wo8yiNHg5RZ2hlneTKQeigVAdInOFHj+y0hW8/yE NyWg== X-Gm-Message-State: AOJu0Yz0zZ5zR0gAi7uGUy64123L+aYGBd+2L4XnDjGbZ8CBp8dMxXFs 7opv1GyuvNoOAzxBMUxxbsRvpaLjzrF4kQzVMN1FfwBnZ96NzOc6opPZq853o/GDE+30ltL6drz DnESrxI3WW0ZDIyp0aTEmhCzoJdCpaocsrw== X-Gm-Gg: ATEYQzxUiPq/K20ymPYEBI2noXVj+37pbEQi/c0kCFWdT5WatXC8tVGdYlhvdY2Efhk 9rcH+Jj3BmVcjZ4bNysGL6ukR0IPx7UYaiUP8nWZi0bay4I/L4DL2EMW0f15TvYycdRGzLXOPD3 yQw5vvT7mYaO2rPhSTImOScZVA2ekuwcxclTbx+Xw3CVbX+3HZyiSA55PYmd8IE6BiBrU0WqxK2 vj0CIVndmHG4QBsgtSOwOfjYeKEoz1HKGKn68DfFtDCzFIX1ZWANvkfjnPHzKE4mcqxVoKXjWQz +kw0Pw== X-Received: by 2002:a54:438e:0:b0:467:deac:70fa with SMTP id 5614622812f47-46a8a3c80b3mr6183138b6e.2.1774963496628; Tue, 31 Mar 2026 06:24:56 -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: Tue, 31 Mar 2026 15:24:44 +0200 X-Gm-Features: AQROBzDAKar8laUVvh0_6SmtxbFBuYdIb8jzIHP_OGNxLZ7UGVOATQEthmw3ZrE 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="000000000000b4b611064e51e4fe" From: bukka@php.net (Jakub Zelenka) --000000000000b4b611064e51e4fe Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 t= o > >> > 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 f= d > >> > which > >> > is currently hidden and makes harder messing up with stream fd which > >> > 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 be= 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. Thanks Jakub --000000000000b4b611064e51e4fe Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

On Tue, Mar 31, 2026 at 11:2= 3=E2=80=AFAM Tim D=C3=BCsterhus <tim= @bastelstu.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>
Thanks

Jakub
--000000000000b4b611064e51e4fe--