Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125945 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 87B811A00BD for ; Tue, 12 Nov 2024 16:43:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1731429957; bh=u4d4LyQ8r9nIc9CGKqTplR81ASBR73rhcDjkmUdWJ40=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=kThxBDKO/rzvjbfYtibL6bmrZiVClJVsGphC7b3ICerdQlZCwgydi7HfrmkwRb6/W Z1SVwt+NpQKVfrypg5E3UJEXR1Ljkmmulvlt5mgBbaZAl6ULZXYVymfHQw5CIPsyUh xbOiEuys/KIf3SZpCH4Qc03TgXFLYo5MUqcMxq6rFNXqiBNaLXs03lStO8LvvPJ2En s/d+p2Z3333tsrYKLetuRjuOTN13g+acNCrlBUuti5/PyEuirOb0ogau5Be4UCH/Wf 801i49GpkZKfYSSSdkqVH0p5hywG2s5DTMNUpgMCSc3y1ELiCHxN7EVIjJNkKm04Mm d4kcjzaAeWpUQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id EFB8618006C for ; Tue, 12 Nov 2024 16:45:56 +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, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (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 Nov 2024 16:45:53 +0000 (UTC) Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-a99e3b3a411so1190931066b.0 for ; Tue, 12 Nov 2024 08:43:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731429797; x=1732034597; darn=lists.php.net; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=u4d4LyQ8r9nIc9CGKqTplR81ASBR73rhcDjkmUdWJ40=; b=PT8Fle09uJM8FtyPhnI5RqGEEvDq3kTX2mn15QBFVxJQOq/Y8GIKgZH5BeBNKKG8UM 4p6pNk/bErRV3M2Gns5Nek+6sUQ+VmWd9wwrdJH+HXdzmk6BoU4ulS6D9ZM4feJ3IHgR tybXb8VQRMLKDBrohx/4qJjKk9vqvBx6zfDVn1pd0asbrb74Escpydsjpn94JeGzryr/ VaW0Y1vmbLxX0DcQYCy/0FA8Cc2UILYFvyhnXr02AjO624F6LcHr383xqKvNSwCWuLkF PfuC+3bGtzXa44MGGOCXvjZpW5vRfZ8pgMRaqBAIF9RAz0VJRPH0b+StHzO+XycAeEcT 6Q4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731429797; x=1732034597; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=u4d4LyQ8r9nIc9CGKqTplR81ASBR73rhcDjkmUdWJ40=; b=FEPtTjVo+C2uBab0B3qlz+80wv0/UK1LFP6jJETww2SYWv+BuG1noefRetdwBw5M3N f4lItXA1sevFtDfBejiI/I0X9hh3y3Sq0gZuLkObrdM8N9FqcktrCfnOK9q019dRw58Y jwAzqQopJMCtwQ2guBeiUB8zft7mcu34JUTtBs4OHVUAnb/HnhT/dTZ5nkoakirX1oPu AJkusUrqjV7fX4WSrFo/4GL/qWk/FjYyrFpZdB1n7eWfo30bIwivbrc6i+Bd7RyF/CJ+ LenYu4+dVYX5TuxSqAtqPH5xoOQyUUaBrsaoFyB8LJx3ZllDMUFu3v+LTb4P16cnIXrd dkrQ== X-Gm-Message-State: AOJu0Yx4ZV3UQxCSreCa5D95bapmpU71yG175ulHsDJTgFamPLiSHQ5K N04Uj08Qi+S6b0ofvZTtu+uGH5AG6QYoOcvtCA0UvXNmTAqhXPfB X-Google-Smtp-Source: AGHT+IEyzNWKD1xT/URlywKJcCeyZAiFzywIIMS4N2WVxUfgVTkLu1g2/mTSNZaxNA8E/IFKkrp9gw== X-Received: by 2002:a17:907:da1:b0:a9a:1ef0:837b with SMTP id a640c23a62f3a-a9eec982193mr1675453566b.10.1731429796592; Tue, 12 Nov 2024 08:43:16 -0800 (PST) Received: from smtpclient.apple ([89.249.45.14]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9ee0e2ec75sm744075666b.188.2024.11.12.08.43.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Nov 2024 08:43:15 -0800 (PST) Content-Type: text/plain; charset=utf-8 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51.11.1\)) Subject: Re: [PHP-DEV] Make Closure covariant to callable In-Reply-To: Date: Tue, 12 Nov 2024 17:43:04 +0100 Cc: PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: <461FD462-72A8-42D4-B6A2-CA10AC5CA395@gmail.com> References: To: "Gina P. Banyard" X-Mailer: Apple Mail (2.3776.700.51.11.1) From: claude.pache@gmail.com (Claude Pache) > Le 12 nov. 2024 =C3=A0 14:53, Gina P. Banyard a = =C3=A9crit : >=20 > Hello internals, >=20 > Ond=C5=99ej Mirtes (author of PHPStan) remarked to me in August that = Closure is not a subtype of callable. > The implementation of this is quite straight forward and can be seen = on GitHub. [1] > The question is if there are any concern or not and if this requires = an RFC or can just be merged as is. >=20 > Best regards, >=20 > Gina P. Banyard >=20 > [1] https://github.com/php/php-src/pull/15492 Hi Gina, That seems reasonable. But personally, I would be more interested in having a type equivalent = to `callable&object`, that is all objects that implement the = `__invoke()` magic method (this is a strict super-type of \Closure). =E2=80=94Claude