Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130847 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 B13F51A00BC for ; Tue, 12 May 2026 06:19:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1778566769; bh=oqlUHgMvjcEYmDyxnq6BRZckKFXDx3HsjiVbaf8kIJU=; h=References:In-Reply-To:From:Date:Subject:To:From; b=lyHfouHVTCIt3K0pSSopd5X7WMsC7x+eDwSxQ734TnpVFKVKizdtC8wrByTdZSWjZ zdf01+0M4HCCoaTYuy7yugx6HLgIyHcbFBm1k3w0yZcWk9LA7yLfvL3lTqiphwEeL4 JeF4vEqGzd8ekRZc2E2MhA5YL8bzvQAfBxbkRr30ByoB84UqWlsFOclSadLHDOpqLm aymcqMtPWxmuwUoL2IGHaiIbQxrORmTJ4laP2/wEJ1OKTVm2okJrFwufpMcqAXCkWr g7l8VjPt8ykJ488hYbID5mIhZdJtV5OX9V+cccmpnKsQCRmtLMKL8F+xQ+2Gb3TYTQ p1iVnXe+Pb5Cg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7FC1818006A for ; Tue, 12 May 2026 06:19:28 +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=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_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-ot1-f53.google.com (mail-ot1-f53.google.com [209.85.210.53]) (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, 12 May 2026 06:19:28 +0000 (UTC) Received: by mail-ot1-f53.google.com with SMTP id 46e09a7af769-7de4e6c5a30so5612140a34.0 for ; Mon, 11 May 2026 23:19:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1778566762; cv=none; d=google.com; s=arc-20240605; b=LWrWmSwnZq1PpkKYmQEtCV8GPtc6HQq+zgOtr2INkU242TS0yHPXjMnBES5j5lslzw 8tgICbyL17tLFWpCtvE4Ke5T2G+oYGvLm1OMw5AsVGS/AZnYDLNHAuWWjecq1Sm96qlF N3mYcmrdquafSvOejxpfJAZ7UycS1f2lI5hIrBxPvHnhY94ohfXI0QQ1iMdr+rFQ8xru 72BOJcirLKCsMM06v/l0G78tGwS7tSkte3LmYFvpKtHc6cxn+2mFd/1nely5f0HnBZju ZMqaYE6OPP7rl4GNTyq4itDWfQgda5ul/DsKwuWxmIPqY+9E4Kg3nJ3f4MH92Nkv/kON 58/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=MlBWNTKLaD4MRKbPhFXegYX86hbNzUvAZIcgocvyA1E=; fh=5KvmJ5K5QBymFDNCdtgpPKEwgSxqOQnCzLzHVTYb8GE=; b=JFx5cW+zqrb8Bj2tZfUQ7MbPllN8uiHZKgeF4bp6kFsPlLI25FpxF0I8uF+lUr3Jdd fz7UnCByFyv6VLxXgyRvF3d2WBc74EBlyrHnQFlhK6dBbbBt5C4BKC4tYmoS2In3SNG5 6X8lqPNHnphXUtUwR7F2e8UoW5E1mbigeuMAfmqX9iRPXGJQQTkUkOXh5arQIhLqmEBm UMxnI8dQwnDUFhPgz5a7ZiBZhRFNP8VMHDqPO8WlYGOTRBgI6y3ccThpfu8aK0uvFLwG PPuwz+4fV4g0F4Cp0bRFnfIrNQ7Pn+ul9qT2pyscf61AancqCZqtbEc6Ivjq0+9jc/si x1kA==; darn=lists.php.net ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778566762; x=1779171562; darn=lists.php.net; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=MlBWNTKLaD4MRKbPhFXegYX86hbNzUvAZIcgocvyA1E=; b=L0ShziXXU+UdUDjEKN6bWAR+I0S9T7+lVr+VXLRJ3jYfgad6fCvU+deMd6fNxPUTOZ IGy8pY3H/lkRuvGyYnsYJR6HJNncIS19aX67DXtl7qhdSyGtONb/34j7VEv8ONMaCoyX rf9CuexaSbrrO5JFGollX78rft8HgoOwbym2MnCC8GQ7VKjWwKyOWjASZrW+xAWOaPCM Fbtu/VPeXFv4BnnrBgqrMUcJcUpIvi5YnEbq7AjU8J5MV7Tk9z5FUO6bVTG/8+V/uXom Rdg8y5yHXo+RLyGe+NA+Vz1fJQ6pOvF78ta8WYt9c8QrOWA2UbWcwhdXWy19zeVarq+/ MLOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778566762; x=1779171562; h=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=MlBWNTKLaD4MRKbPhFXegYX86hbNzUvAZIcgocvyA1E=; b=N3YeDIoAaqPKWEd/I8ZBtWfqKpl0PJPdmJH0BV9dkcaGEi1p8v3SlCHl9cuOUaajsU 4UOgpR89xtQA1FOZfCsgYk+KWgFperPe2jmQyNGntOXxAG2J8+vevYITFo783i0gjOSu Vkh/5dgp6YzNnyLVG3K3bMjGTpebVWtpR3F6kvADghL64iPI5PcZdH8O/HEW0dVgNoXq 31FQNj2Rc75P8msWPRl7He1jb/cHlxR8f701pWafXaMLt/ZPTU7Plh4hgZeP3s0g4s3F y/p5j5u8X/niucq81FxfpIj81hRcQLzmSP5jHANCPwTpRZwGhOFJBTGv5/9p1xbER0NY i7bQ== X-Gm-Message-State: AOJu0YzXBYCk9AdWvl5C8arUQGS/1q+WiXPm3QqromSEZGLeMtj6DkkS 5ncfmcljoLdicad9p9zDVKGjsxnt12eNKVukkatb3/0ZqIMsobTL5SL0ZCEH/5h6UitNOwMyJyz 1tJZuYY1kMGdMDItSBVG2rrUzbaGaNsFDbPOUWNY= X-Gm-Gg: Acq92OFf5BXiOyzcy+N6HTC5rqXcYa984gdD+n0jyJcM7oONGZZVLNm6ynKBjPEGsb/ tc7dGVAtVHLWVXfu9gX7TYBptz7ftGST7YNK/vK/kP0IItkfflBIrQCfsCZ7F9In5u8cNu+sPP9 +w5rip26HPI5SmEVTmiNiHlfIiw2eV6Glz34FnH3Nuch2wUzOGQC5I4ykNMCop4czQx2OBnODzu /FGsbWmQrRrptHnZpC8KqoaV49aRxoeBFQqRdj1Nt1cgKkp0LXTNkScxKwqp6zMAq9gC+uGBHoa v5HbKYw= X-Received: by 2002:a05:690e:1765:b0:651:be68:77e3 with SMTP id 956f58d0204a3-65c79e60f8amr20303275d50.31.1778566400174; Mon, 11 May 2026 23:13:20 -0700 (PDT) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: <1775355170615.845602058.475476008@yahoo.de> In-Reply-To: <1775355170615.845602058.475476008@yahoo.de> Date: Tue, 12 May 2026 09:13:09 +0300 X-Gm-Features: AVHnY4KhFyhE5VEh2H6DSOe1i5sqg_HrCuwK0luXUNDxRtSQao6JcYdsNw_D_Sk Message-ID: Subject: Re: [PHP-DEV] RFC proposal: Invokable interface To: internals@lists.php.net Content-Type: multipart/alternative; boundary="0000000000007def74065198c26d" From: aldemeery@gmail.com (Osama Aldemeery) --0000000000007def74065198c26d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable All, Apologies for the long silence. I wanted time to sit with the responses before replying, and that turned into longer than I intended. Thanks for the depth of the replies. The points raised here, and in the discussion on the PR, have shown me things I hadn't seen. I still think there is a real gap between Closure and callable, but I am no longer sure a marker interface is the right shape for filling it. Given that, it doesn't feel right to keep this thread open and ask for more of the list's time on something I'm no longer confident in. I'll step back from the proposal, and I've closed the PR. Thank you all. Regards, Osama Aldemeery On Sun, Apr 5, 2026 at 4:58=E2=80=AFAM Hans Krentel = wrote: > On Thursday 02 April 2026 16:23:03 (+02:00), Matthew Weier O'Phinney wrot= e: > > > If you define mixed, you cannot have a void or never return. > > We can't speak for Liskov (only she can), but as far as stable PHP is > concerned never is actually fine, and should also stand a common > interpretation of LSP, as never is the bottom type and henceforth a > specialization of mixed. (Some may go for void, too, but that is far more > abstract and does not work conceptually in PHP if I'm not mistaken.) > > Furthermore, the PHP runtime also guarantees that any function can never > return, not only by the never return type. > > So it's at least irrelevant to implement a new throwable via an invocable > mixed interface or never, the invocation in the runtime guarantees the > higher contract to the return: > > > interface invocable { > public function __invoke(): mixed; > } > > $o =3D new class implements invocable { > public function __invoke(): never {} > }; > > $o(); > > Interface violation normally yields a compile error, not a type error, > nowadays. > > So if you think that is an error, the discussion should have brought > something to the table. > > -- hakre > --0000000000007def74065198c26d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
All,
Apologies for the long silence. I wanted time to s= it with the responses before replying, and that turned into longer than I i= ntended.

Thanks for the depth of the replies. The points raised here= , and in the discussion on the PR, have shown me things I hadn't seen.<= div>I still think there is a real gap between Closure and callable, but I a= m no longer sure a marker interface is the right shape for filling it.

Given that, it doesn't feel right to keep this thread op= en and ask for more of the list's time on something I'm no longer c= onfident in.
I'll step back from the proposal, and I've c= losed the PR.

Thank you all.

<= div>Regards,
Osama Aldemeery

On = Sun, Apr 5, 2026 at 4:58=E2=80=AFAM Hans Krentel <hanskrentel@yahoo.de> wrote:
On Thursday 02 April 2026 16:23:03 (+= 02:00), Matthew Weier O'Phinney wrote:

=C2=A0> If you define mixed, you cannot have a void or never return.

We can't speak for Liskov (only she can), but as far as stable PHP is <= br> concerned never is actually fine, and should also stand a common
interpretation of LSP, as never is the bottom type and henceforth a
specialization of mixed. (Some may go for void, too, but that is far more <= br> abstract and does not work conceptually in PHP if I'm not mistaken.)
Furthermore, the PHP runtime also guarantees that any function can never return, not only by the never return type.

So it's at least irrelevant to implement a new throwable via an invocab= le
mixed interface or never, the invocation in the runtime guarantees the
higher contract to the return:

=C2=A0 =C2=A0 =C2=A0<?php

=C2=A0 =C2=A0 =C2=A0interface invocable {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0public function __invoke(): mixed;
=C2=A0 =C2=A0 =C2=A0}

=C2=A0 =C2=A0 =C2=A0$o =3D new class implements invocable {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0public function __invoke(): never {}
=C2=A0 =C2=A0 =C2=A0};

=C2=A0 =C2=A0 =C2=A0$o();

Interface violation normally yields a compile error, not a type error,
nowadays.

So if you think that is an error, the discussion should have brought
something to the table.

-- hakre
--0000000000007def74065198c26d--