Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127636 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 EAEDC1A00BC for ; Tue, 10 Jun 2025 19:45:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1749584638; bh=RA8KdHlQaZFRuCNfBN1zCRUmgLipJupnEZ4s8zpRVmw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Qe30c9ObyzAVyi1bWJ/FVX+yuEJ7BWs7BIUdymttwhCLWtnKWHI0v4EW7V4UXpBe9 4xuCAkFfb5pPTDomrozzehdXtTymgrgCd7zkEhvINr+mrnhmp5vVZiLmwBDff53jwg p/BnZIU3M3UG/zvUphWV48d11moEQHz30GY46QKGD87tIVY1pTkOcxCV8ZSpMuIXbH OEmVBJqzn7gw+mcJiVUfokZA+5vHPJ+Z2jxaPFPN/kSE/6Faxjow1DmTIhi8iuYhvC Xxf084jPc/1DmZX9X3r3IFvnA0Hmls7GlNVrieQWFlLvU1icQEVZpxwdlYdQ5ljSOP ErQRfTxP3l+ow== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B80AB180074 for ; Tue, 10 Jun 2025 19:43:57 +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: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) (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, 10 Jun 2025 19:43:57 +0000 (UTC) Received: by mail-pg1-f178.google.com with SMTP id 41be03b00d2f7-b2c4e46a89fso4346017a12.2 for ; Tue, 10 Jun 2025 12:45:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749584758; x=1750189558; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ZeJEH7FEB6Br+swx4ekWU5mcN6ZgRknZ2/VVVIy8nU4=; b=ZOzBlN6Ewdbf8DU7uYBD/Bi8FA/aHIYlzDNrangzLYPsiqKttZ7fIrK6YU+7tR5yB3 JnmqTxYBek5r43iG4aoZySwtuivNJMihO1okfqFoaGkJXLUbc6OcEOJnFbbKQBmQTYQJ LE+YTE/RFMcU4sc1D9zu8LYV/4OYevGE0GoCqhe4O70eS3GPojLVwMKNG9fpO62AdjtM jqj7B4wJhQlihSdlz0U4z+dCkUzzSMZGUzNsi47hj8C6NRjydUQeVkUA4l2POUPdSykE 4Pcdi4ICnF4bR1ulAjVWzCXWxwNbN2L5n9XmHHJm6sesbIxyuiHQu2XWexq0r72caBkc Ju6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749584758; x=1750189558; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZeJEH7FEB6Br+swx4ekWU5mcN6ZgRknZ2/VVVIy8nU4=; b=nRkGBISCOywhPpD7xX/zgiwOJrpPc0g84PGcdR4BnqjldWJRf8kacaeTN9GqLD5iRG QT/aRctk0s4TBL9bkWPVZJqxuI3Q+BRNIPis6u3ZKkXAYMnY+uTqL7KNBap4+0FWhxEp iCdL2A5kVyZU6k9rrpOxHbfmRGjbSk3NsgzcfbBD7uXW4tsDm15Mme48ptcRK+AyohNH DfvBwz0xjRB1IuvEhueF6BCQHgJLtb9NHfk+LicEOiZScqH2mZHuzVI6+x+4iSRlaPeU zq3KTGuMCrJtmr9PvxL3dhMyE5AB7+HS4h61bVJzqej2lffhQS73zZumUecj5KdYZOUH r7uA== X-Gm-Message-State: AOJu0YzX0RmK3pdbbDdDQF0S+wwtvD5dO0W/fuMZtirb28SXu4UFzyw1 laWdlmiXuYeJhGNV7+WRNai47pheFbc/0MbJ9ZZVwVz2f9dlsnEApan6KwtBGo1KpyYbFvWcI6W dvjGwJapdg0hSbM4y+QUKryRDJcBwjf95vloTrzI= X-Gm-Gg: ASbGnct8ioFg6rkaARqjw75/56ZLL8lcC9nH/DEjWBoMrrR1bEcDOOHIaw6U2gSl6fs 4mA6K0HzhLMicg/yNlRy4k294uPUKNwNjSyp7sXGiMQVrWIBEvYGAgF4RWzRVZKOn6Nw17G7C/k j2x0mKo8S6utIPB6x+yUj8kCBPW7SRVlU8Gpw9BgVwOFzgS1BNaTQSnHw= X-Google-Smtp-Source: AGHT+IGZn5LcslXUUvp2WmXQJ0oHXsPCgslZ72JaicyC08RA/TQ+t91CPY1c3kWtw2yWSoL9JYFUZXAK0L9VGFU0B/s= X-Received: by 2002:a17:90b:3c45:b0:313:31ca:a69 with SMTP id 98e67ed59e1d1-313af23de99mr1214437a91.18.1749584757839; Tue, 10 Jun 2025 12:45:57 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 10 Jun 2025 22:45:46 +0300 X-Gm-Features: AX0GCFsQoLrqzB5mzWMqtmhvD_Je4BJoBcOOO1U6Vbrf-1oFYoxID-qryGQli4I Message-ID: Subject: Re: [PHP-DEV] Feature Discussion | To: Larry Garfield Cc: php internals Content-Type: multipart/alternative; boundary="000000000000feda1d06373cf17a" From: xepozzd@gmail.com (Dmitry Derepko) --000000000000feda1d06373cf17a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks for participating, Larry. On Mon, Jun 9, 2025 at 10:29=E2=80=AFPM Larry Garfield wrote: > 2. Please link to a PR of your actual implementation. In context it look= s > like your branch comparison link is to the version you said didn't work, = so > it's not that helpful. > Correct, I don't have another one. This is big feature, I need a lot of time to implement it. I don't want to waste my time if we decide that RFC won't pass at all. > 3. The biggest question that has come up in the past (Ilija and I have > discussed it at length) is, naturally, autoloading. How if at all do you > address that? > In the original message I mentioned `use extension` construction. This should be enough for solution, isn't it? > 4. The other big question was determining when to match a given "method" > call to an extension function, when the type of a variable is not always > known at compile time. How did you address this? > Cannot understand the passage, could you explain more? The only one way to use these extension functions =E2=80=93 import them. namespace A { use B\Foo; function Foo::hello(){...} function Bar::hello(){...} <---- Error, unknown Bar class } namepsace B { class Foo {} new Foo->hello() <--- Error, hello() is not a member of Foo } namepsace C { use B\Foo; use extension function A\Foo::hello; new Foo->hello() <-- Everything's great } --=20 Best regards, Dmitrii Derepko. @xepozz --000000000000feda1d06373cf17a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks for participating= , Larry.



=
On Mon, Jun 9, 2025 at 10:29=E2=80=AFPM Larry Garfield <= ;larry@garfield= tech.com> wrote:
2. Please link to a PR of your actual implementation.=C2=A0 In context = it looks like your branch comparison link is to the version you said didn&#= 39;t work, so it's not that helpful.

Correct, I don't have another one. This is big feature, I need= a lot of time to implement it. I don't want to waste my time if we dec= ide that RFC won't pass at all.
=C2=A0
3. The biggest question that has come up in the past (Ilija and= I have discussed it at length) is, naturally, autoloading.=C2=A0 How if at= all do you address that?

In the= original message I mentioned `use extension` construction. This should be = enough for solution, isn't it?
=C2=A0
4. The other big question was determining when to match a given = "method" call to an extension function, when the type of a variab= le is not always known at compile time.=C2=A0 How did you address this?
=

Cannot understand the passage, coul= d you explain more?

The only one way to use these = extension functions =E2=80=93 import them.

namespa= ce A {
=C2=A0 use B\Foo;

=C2=A0 function= Foo::hello(){...}
=C2=A0 function Bar::hello(){...} <---- Error, u= nknown Bar class
}

namepsace B {
=C2=A0 class F= oo {}

=C2=A0 new Foo->hello() <--- Error, he= llo() is not a member of Foo
}

namepsace C {
=C2=A0 use B\Foo;
=C2=A0 use extension function A\Foo::h= ello;

=C2=A0 new Foo->hello() <-- Everything= 's great
}


--
Best regards,
Dmitrii Derepko.
--000000000000feda1d06373cf17a--