Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126757 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 9CD501A00BC for ; Fri, 14 Mar 2025 17:05:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1741971786; bh=n4B/Ek4gefvvImJh9s8jha56HICDfpyxbDfHJUkTDsw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Ex9mw4YCGiG3bj41XWZVKmEE7YRTQro2Uy0AbzGxKieWigxG82jh+OH2t/f1EeIvj z4DnEHHYhUnf9dj12tL/qFaULmp/KTWw98LsGtaSOYUn+JHH0ZBkcHmZDPE+ThU3eX OdO7+NkFjj2DZWJbG4hAvNM8lxBkqPRyyANkNHbt0Tkr15yO8FC3f7GY1tBsCFLKxe jj+/RPqycMe/ktDVn7qUt6gNh81eOg2TfPPJ61047oNhIZHWmu0qqDYsK1uhBYiQEf wOzbim+ycAQDkvipBZbNV/uI6hpf1o1HKGoWul1jLJYms5kUGlZ2mApzQu2VlG7suC FKtzBa805+eZA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BB69E18004E for ; Fri, 14 Mar 2025 17:03:05 +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=-2.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_PDS_PRO_TLD autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from iguana.tulip.relay.mailchannels.net (iguana.tulip.relay.mailchannels.net [23.83.218.253]) (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 ; Fri, 14 Mar 2025 17:02:44 +0000 (UTC) Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 0AE0B4E5772; Fri, 14 Mar 2025 17:05:16 +0000 (UTC) Received: from server42.areait.lv (trex-7.trex.outbound.svc.cluster.local [100.118.31.6]) (Authenticated sender: yszpovajlk) by relay.mailchannels.net (Postfix) with ESMTPA id EB5724E5A96; Fri, 14 Mar 2025 17:05:14 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1741971915; a=rsa-sha256; cv=none; b=7ctdeBnd6Ro4FsrwFqoD6L/gxvuMv6GuhMokMXlFBkK3s2MfbjuW3T21uSlMWMYF8W/yz2 wtN9PYjoIEuOK7mE+DcewZcokWXR8Dlt5mXKWDZuFsuw0axqifVKmy93YOF9km6CYLoAht o8oyPbnQicFgQMOHTV+YnmgT/L1+d68vWarsqzahvh3pCubnKiXC5nbVj5bVFA1N0wB8EN icagZA4ej32SHqrkzlX5KmP0xj4d4LgeoPFYkhk64zwcXfrX4XGAbQStkVVs1mQfBvQguE 9CDibS0DRxmzkQzd/T7t3Lg2eFde2C+dyK/vvYnsyuUCohErr06hJeBLBEcEEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1741971915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature; bh=RFK6W3F3HSzTRaXwXMA6Uy8WJTsxWFzXujLX7F8/wo0=; b=4NzPRySuZvnQXQlMFI6ibZYY1EeH2QFJFCNSk1H8mahFq1rl4PjEL7GuWU/Li67PaXNPcw lhLLqvNGQ8hWopTMOKps5AHpsvYzBSQhFsOYXn0cXiR17X/9x9PHvlHNVjlYNaHDFz4kl9 vV5++xPuEq9uNlcyRQ1CFoML/OoQoeGVnaxtFf/zzivqnHEIpX5JdKm4mfw9D1bhhBwYn4 ggCFZZcc9jEmA7y6+wZ7GqVMikxvnw/LWq6u6s0Z1DXdnyP3587/4ZDEOJkxAoU9gW9tPi UyINFi0z5D0dHze8MWdp9znDPS2IsSlDXiM8RzL1PfistbJG9lKHGYfDlBO8ig== ARC-Authentication-Results: i=1; rspamd-7788c767f-6p7z6; auth=pass smtp.auth=yszpovajlk smtp.mailfrom=juris@glaive.pro X-Sender-Id: yszpovajlk|x-authuser|juris@glaive.pro X-MC-Relay: Neutral X-MailChannels-SenderId: yszpovajlk|x-authuser|juris@glaive.pro X-MailChannels-Auth-Id: yszpovajlk X-Macabre-Stop: 5b8f960c564f8f4a_1741971915690_3054272249 X-MC-Loop-Signature: 1741971915690:3472131231 X-MC-Ingress-Time: 1741971915689 Received: from server42.areait.lv (server42.areait.lv [212.7.207.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.118.31.6 (trex/7.0.2); Fri, 14 Mar 2025 17:05:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=glaive.pro; s=default; h=Content-Type:Message-ID:References:In-Reply-To:Subject:Cc:To: From:Date:MIME-Version:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=RFK6W3F3HSzTRaXwXMA6Uy8WJTsxWFzXujLX7F8/wo0=; b=mga1P6Uz9k19c/9xyvt6GuREkS a4E0xXVQlo+wMWIRJdZx3EiUCVUK2rKuZ5AtlX43b2eUHRK2QlSPsTAjq4zwmsfZhGt9UXSa5oKvm fuIPfM3p+vJGt57i9QX7HXR1Wj5DOYrTIAy9VVpIYDMvnyNGXp+fwfG3OUaqtDxx1oKz2APBER0PV oJKPtSWMo93fWOzA2vKN/JaUEMINLttoqd1z+UGbtgDC6daZ0YREzEPEzYvJ6+FHn22esE7rB05N6 rmFOjNW1HypZUaXdDnk+8o6UjO66AmAyR1dg5BvGg/Y2yfS6kkVU9YV0yTE/99Kc/RwoHTN/NRYXn JOGpmrMg==; Received: from [::1] (port=54362 helo=glaive.pro) by server42.areait.lv with esmtpa (Exim 4.96.2) (envelope-from ) id 1tt8TA-007bXZ-24; Fri, 14 Mar 2025 19:05:13 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Fri, 14 Mar 2025 19:05:12 +0200 To: Viktor Khramov Cc: php internals Subject: Re: [PHP-DEV] [RFC] [Discussion] Optional interfaces In-Reply-To: References: <087a01db596a$e7525660$b5f70320$@glaive.pro> User-Agent: Roundcube Webmail/1.4.8 Message-ID: X-Sender: juris@glaive.pro Organization: SIA "Glaive.pro" Content-Type: multipart/alternative; boundary="=_9dd6076eb56262bf1a224d5cc293e18e" X-AuthUser: juris@glaive.pro From: juris@glaive.pro (Juris Evertovskis) --=_9dd6076eb56262bf1a224d5cc293e18e Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed On 2025-03-14 16:24, Viktor Khramov wrote: > Hey Juris. > > I have a question about this feature. > > At the example blow > >> interface A >> { >> public function x(Foo $foo); >> } >> >> interface B >> { >> public function x(Bar $foo); >> } >> >> class Test implements ?A, ?B >> { >> } > > what would happen if both interfaces existed? Hi Viktor, If `A` exists then `?A` is equivalent to `A`. In your example Test will implement both A and B. If Test::x() will be incompatible with either A::x() or B::x(), you will end up with an error. BR, Juris --=_9dd6076eb56262bf1a224d5cc293e18e Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=UTF-8

On 2025-03-14 16:24, Viktor Khramov wrote:

Hey Juris.

I have a question about this feature= =2E

At the example blow

interface A
{
&n= bsp;  public function x(Foo $foo);
}

interface B
= {
   public function x(Bar $foo);
}

cl= ass Test implements ?A, ?B
{
}
what would happen if both interfaces existed?

Hi Viktor,

If `A` exists then `?A` is equivalent to `A`.

In your example Test will implement both A and B.

If Test::x() will be incompatible with either A::x() or B::x(), you will= end up with an error.

BR,
Juris

--=_9dd6076eb56262bf1a224d5cc293e18e--