Re: [PHP-DEV] Protected inheritance hierarchies

2025-08-02 Thread Valentin Udaltsov
On Sat, Aug 2, 2025, at 22:17, Rob Landers wrote: > On Sat, Aug 2, 2025, at 19:04, Alexandru Pătrănescu wrote: > > > > On Sat, Aug 2, 2025, 17:10 Rob Landers wrote: > > > > > On Sat, Aug 2, 2025, at 16:04, Alexandru Pătrănescu wrote: > > > > On Sat, Aug 2, 2025 at 12:10 PM Rob Landers wrote: >

Re: [PHP-DEV] [RFC] JSON Schema validation support

2025-07-04 Thread Valentin Udaltsov
On Sta, 5 July 2025 at 00:04, Jakub Zelenka wrote: > Hello, > > I would like introduce and open discussion for RFC proposing the addition > of JSON Schema validation support to JSON extension: > > https://wiki.php.net/rfc/json_schema_validation > > If this is successful, it should be just the fir

Re: [PHP-DEV] Concept: constructor overloading syntax sugar

2025-02-18 Thread Valentin Udaltsov
On Tue, 18 Feb 2025 at 12:45, Sebastian Bergmann wrote: > Am 18.02.2025 um 09:00 schrieb Rowan Tommins [IMSoP]: > > named constructors make a lot more sense than type-based overloads > > +1 > Hi, Viktor. I agree with others that named static constructors are much better than overloading of the

Re: [PHP-DEV] RFC: Not Null Assertion Operator

2025-02-11 Thread Valentin Udaltsov
On Friday, 7 Feb 2025 at 10:45, Faizan Akram Dar wrote: > > > On Fri, 7 Feb 2025, 08:30 Mihail Liahimov, <91lia...@gmail.com> wrote: > >> Thank you for your answer. Now I will give examples for better >> understanding. >> >> Simple examples from Typescript: >> >> let foo = ... >> foo!.bar() >> fo

Re: [PHP-DEV] Pattern matching details questions

2025-02-06 Thread Valentin Udaltsov
On Tue, 4 Feb 2025 at 07:35, Larry Garfield wrote: > Hi folks. Ilija is still working on the implementation for the pattern > matching RFC, which we want to complete before proposing it officially in > case we run into implementation challenges. > > Such as these, on which we'd like feedback on

Re: [PHP-DEV] Optional interfaces

2024-11-16 Thread Valentin Udaltsov
On Sat, 16 November 2024 at 13:42 Rob Landers wrote: > On Sat, Nov 16, 2024, at 10:02, Juris Evertovskis wrote: > > Is there some reason you cannot do this: > > > > https://3v4l.org/hF1vr > > > > Unless I’m missing something, you can’t patch-define a namespaced > OptionalInterface that easily. >

Re: [PHP-DEV] RFC: Support Closures in constant expressions

2024-10-29 Thread Valentin Udaltsov
On Tuesday, 29 October 2024 at 18:14, Tim Düsterhus wrote: > Hi > > Volker and I would like to start discussion on our RFC to "Support > Closures in constant expressions". > > Please find the following resources for your reference: > > - RFC: https://wiki.php.net/rfc/closures_in_const_expr > - Im

Re: [PHP-DEV] [RFC] Change behaviour of array sort functions to return a copy of the sorted array

2024-10-21 Thread Valentin Udaltsov
On Mon, 21 October 2024 г. at 18:13, Gina P. Banyard wrote: > > On Monday, 21 October 2024 at 14:29, Ilija Tovilo > wrote: > > > Hi Gina > > > > On Mon, Oct 21, 2024 at 3:21 PM Gina P. Banyard intern...@gpb.moe wrote: > > > > > On Sunday, 20 October 2024 at 18:42, Gina P. Banyard intern...@gpb.m

Re: [PHP-DEV] Asymmetric visibility is a BC break

2024-10-13 Thread Valentin Udaltsov
On Mon, 14/10/2024 at 06:01, Larry Garfield wrote: > > On Sun, Oct 13, 2024, at 9:37 PM, Valentin Udaltsov wrote: > > > > First of all, I have already agreed above that PHP does not have a BC > > break here. Now we are discussing the potential problems in the PHP > >

Re: [PHP-DEV] Asymmetric visibility is a BC break

2024-10-13 Thread Valentin Udaltsov
On Mon, 14/10/2024 05:01, Jordan LeDoux : > > > > On Sun, Oct 13, 2024 at 5:03 PM Valentin Udaltsov > wrote: >> >> On Mon, 14 Oct 2024 at 01:28, Jordan LeDoux : >> > Backwards compatible has never, in any work I've done through my entire >> >

Re: [PHP-DEV] Asymmetric visibility is a BC break

2024-10-13 Thread Valentin Udaltsov
On Mon, 14/10/2024 04:07, Bilge wrote: > > On 14/10/2024 01:02, Valentin Udaltsov wrote: > > The problem is that in practice most of the PHP libraries consider > > themselves to be compatible with newer PHP versions. > > > > For instance, Symfony PropertyInfo uses

Re: [PHP-DEV] Asymmetric visibility is a BC break

2024-10-13 Thread Valentin Udaltsov
On Mon, 14 Oct 2024 at 01:28, Jordan LeDoux : > Backwards compatible has never, in any work I've done through my entire > career, meant something like "if you take old code and then update it to the > new version incorrectly, it doesn't work"... that seems... obvious? > > What exactly is the clai

Re: [PHP-DEV] Asymmetric visibility is a BC break

2024-10-10 Thread Valentin Udaltsov
On 09.102024 at 19:20 Claude Pache wrote: > There is no BC break, in the sense that code that worked under PHP 8.3 (and > therefore use PHP 8.3 features only) will not break when run under PHP 8.4. > > Of course, code that makes assumptions that are true when using PHP 8.3 > features only, will

Re: [PHP-DEV] Asymmetric visibility is a BC break

2024-10-10 Thread Valentin Udaltsov
On 09.10.2024 19:08, Kamil Tekiela wrote: > > I have to admit I understood nothing from your email, but I got > curious about some of your words. Hi, Kamil! I tried my best :) Thank you for your interest! > > A readonly property is two functionalities in one: write-once and > private set. > > Wh

[PHP-DEV] Asymmetric visibility is a BC break

2024-10-09 Thread Valentin Udaltsov
Hi, internals! Since writing https://externals.io/message/125740 I've realized that the major problem with aviz is actually simple but fundamental. In PHP <=8.0 this code is valid for an object of any user class: ```php class User { public string $name = 'Bob'; } $object = new User(); forea

[PHP-DEV] Asymmetric visibility Reflection API problems

2024-10-03 Thread Valentin Udaltsov
Hi, internals! Recently I've started testing the new features of the PHP 8.4 Reflection API and found some of them unintuitive. At first, I reported this as a bug [1], but then Ilija explained that the behavior is intentional. So I've decided to discuss the issue publicly. We are going to talk ab

Re: [PHP-DEV] [Discussion] Implementing interfaces via traits

2024-08-29 Thread Valentin Udaltsov
On Tue, 27 August in 2024 at 10:31, Brent Roose wrote: > Good morning internals > > I’d like to test the waters about an RFC idea: allowing traits to > implement interfaces, and consequently a class that uses such a trait will > automatically implement the interface as well. > > The original idea

Re: [PHP-DEV] Re: [RFC] [vote] Support object type in BCMath

2024-08-24 Thread Valentin Udaltsov
On Thursday, May 16 2024 at 17:22, Saki Takamachi wrote: > Hi all, > > > 2024/05/01 17:55、Saki Takamachi のメール: > > > > Hi all! > > > > Voting for RFC: Support object type in BCMath has started. Voting ends > on 2024-05-16 00:00 GMT. > > https://wiki.php.net/rfc/support_object_type_in_bcmath > > >

Re: [PHP-DEV] State of Generics and Collections

2024-08-19 Thread Valentin Udaltsov
On Monday, 19 of August 2024 г. at 20:11, Derick Rethans wrote: > Hi! > > Arnaud, Larry, and I have been working on an article describing the > state of generics and collections, and related "experiments". > > You can find this article on the PHP Foundation's Blog: > > https://thephp.foundation/b

Re: [PHP-DEV] [RFC][Vote] RFC1867 for non-POST HTTP verbs

2024-07-08 Thread Valentin Udaltsov
On Wed, 24 Jan 2024 г. at 14:01, Ilija Tovilo wrote: > Hi Sara > > Thank you for your feedback. > > On Tue, Jan 23, 2024 at 8:41 PM Sara Golemon wrote: > > > > On Mon, Jan 22, 2024 at 1:24 AM Ilija Tovilo > wrote: > > > > > I started the vote on the "RFC1867 for non-POST HTTP verbs" RFC. > > >

Re: [PHP-DEV] Static class

2024-06-15 Thread Valentin Udaltsov
to support this idea, because it makes intent more expressive and allows to get rid of `private function __construct() {}` visual debt. I also agree that static implies final. This could be later changed without breaking BC. Good luck, Bilge! -- Valentin Udaltsov

Re: [PHP-DEV] Revisiting case-sensitivity in PHP

2024-06-14 Thread Valentin Udaltsov
eaning No on this change, because the > cost/reward/backlash ratio is just not there to support it. > > --Larry Garfield > > Would be good to see some real-world metrics, whether or not they're the > principal/only reason this might be a good change. > > Bilge > > Yes, I am working on this. -- Valentin Udaltsov

Re: [PHP-DEV] Revisiting case-sensitivity in PHP

2024-06-13 Thread Valentin Udaltsov
ntually end up with the same problem, when transition to case sensitivity is complete. Hence I propose no deprecation layer — it does not really help. However, you will be able to use `class_alias()` to solve your issue. If classes are case-sensitive, `class_alias(MyClass::class, 'myclass');` should work, since MyClass != myclass anymore. And serialization works perfectly with class aliases, see https://3v4l.org/1n1as . -- Valentin Udaltsov

Re: [PHP-DEV] Revisiting case-sensitivity in PHP

2024-06-11 Thread Valentin Udaltsov
On Tue, 11 June 2024 at 17:13, Levi Morrison wrote: > On Mon, Jun 10, 2024 at 9:40 PM Ben Ramsey wrote: > > > > > On Jun 10, 2024, at 20:35, Valentin Udaltsov < > udaltsov.valen...@gmail.com> wrote: > > > > > > Hi, internals! > > > > &

[PHP-DEV] Revisiting case-sensitivity in PHP

2024-06-10 Thread Valentin Udaltsov
ormance penalty. At the same time, a gradual approach will reduce the stress. So the plan for 8.4 might be to just drop case insensitivity for class names and that's it... Let's discuss that! -- Best regards, Valentin Udaltsov

Re: [PHP-DEV] [RFC][Vote] Property Hooks

2024-06-10 Thread Valentin Udaltsov
On Sunday, 9 June, 2024 at 19:03, Nikita Popov wrote: > On Mon, Apr 15, 2024, at 18:43, Larry Garfield wrote: > > The vote for the Property Hooks RFC is now open: > > https://wiki.php.net/rfc/property-hooks > > Voting will close on Monday 29 April, afternoonish Chicago time. > > > The other thing

Re: [PHP-DEV] Default value for readonly properties

2024-06-07 Thread Valentin Udaltsov
working example (https://3v4l.org/dSpQO) where `$storage` can not be replaced with a constant. And it would be nice if `$storage` could be initialized without a constructor. I just looked at some of my PHP >=8.1 projects and noticed that I have a few places where the constructor has no parameters and only exists to initialize readonly properties with smth like `SplQueue`. -- Valentin Udaltsov

Re: [PHP-DEV] [RFC] Lazy Objects

2024-06-04 Thread Valentin Udaltsov
On June, 4 at 15:32, Nicolas Grekas wrote: > Dear all, > > Arnaud and I are pleased to share with you the RFC we've been shaping for > over a year to add native support for lazy objects to PHP. > > Please find all the details here: > https://wiki.php.net/rfc/lazy-objects > > We look forward to yo

Re: [PHP-DEV] [Discussion] Why can't I do "{$a::class}"?

2024-05-29 Thread Valentin Udaltsov
https://www.php.net/manual/en/language.types.string.php#91628 > Hi, Peter! > Also, as a side note, why does this hack below work? It's not a hack. Variables, including callable ones with any arguments are allowed to be interpolated. See another example: https://3v4l.org/BJUvL -- Regards, Valentin Udaltsov

[PHP-DEV] Re: [RFC][Vote] new MyClass()->method() without parentheses

2024-05-28 Thread Valentin Udaltsov
On Thursday, 9 May 2024 at 18:26, Valentin Udaltsov < udaltsov.valen...@gmail.com> wrote: > The vote for the RFC that allows to omit parentheses around the `new` > expression is now open: > > https://wiki.php.net/rfc/new_without_parentheses > > Voting will close on

Re: [PHP-DEV] Extract ArrayAccessRead from ArrayAccess

2024-05-27 Thread Valentin Udaltsov
On Mon, May 27, 2024 at 14:21 Alexandru Pătrănescu wrote: > > On Mon, May 27, 2024 at 7:16 AM Valentin Udaltsov < > udaltsov.valen...@gmail.com> wrote: > >> Hello, internals! >> >> Here's the idea: let's extract `ArrayAccess::offsetExists` and >&

[PHP-DEV] Extract ArrayAccessRead from ArrayAccess

2024-05-26 Thread Valentin Udaltsov
hen interfaces of the doctrine/collections package might look like this: namespace Doctrine\Common\Collections; interface ReadableCollection extends Countable, IteratorAggregate, ArrayAccessRead {} interface Collection extends ReadableCollection, ArrayAccess {} ``` -- Regards, Valentin Udaltsov

Re: [PHP-DEV] RFC [Discussion]: array_find

2024-05-24 Thread Valentin Udaltsov
I'm looking forward to your feedback. > Cheers > Joshua Rüsweg > > Hi, Joshua! Have you considered renaming `$callback` parameter to `$predicate`? I always considered "callback" to be a very generic word. Predicate, on the contrary, implies accepting a value and returning a bool. -- Valentin Udaltsov

Re: [PHP-DEV] [RFC] [Discussion] new MyClass()->method() without parentheses

2024-05-09 Thread Valentin Udaltsov
Yes, I've done that, see https://externals.io/message/123293. чт, 9 мая 2024 г. в 20:11, Larry Garfield : > On Thu, May 9, 2024, at 3:26 PM, Valentin Udaltsov wrote: > > @Lynn, @Alex, thank you for your comments. I have improved the "without > > constructor arguments&

[PHP-DEV] [RFC][Vote] new MyClass()->method() without parentheses

2024-05-09 Thread Valentin Udaltsov
The vote for the RFC that allows to omit parentheses around the `new` expression is now open: https://wiki.php.net/rfc/new_without_parentheses Voting will close on Friday 24 May, 00:00 GMT. -- Best regards, Valentin

Re: [PHP-DEV] [RFC] [Discussion] new MyClass()->method() without parentheses

2024-05-09 Thread Valentin Udaltsov
wrote: > >> On Tue, Apr 23, 2024 at 11:10 AM Valentin Udaltsov >> wrote: >> > >> > >> > Does anyone have additional feedback? I'd like to start voting on >> Thursday, April 25th. >> > I've also added a section on other syn

Re: [PHP-DEV] [RFC] [Discussion] new MyClass()->method() without parentheses

2024-04-23 Thread Valentin Udaltsov
вт, 9 апр. 2024 г. в 19:41, Larry Garfield : > On Mon, Apr 8, 2024, at 6:08 AM, Valentin Udaltsov wrote: > > Hello internals, > > > > > > > > I would like to propose a syntax change for PHP 8.4 that allows to > > immediately access instantiated objects w

Re: [PHP-DEV] [RFC] [Discussion] new MyClass()->method() without parentheses

2024-04-09 Thread Valentin Udaltsov
> > On Mon, Apr 8, 2024, at 6:08 AM, Valentin Udaltsov wrote: > > Hello internals, > > > > > > > > I would like to propose a syntax change for PHP 8.4 that allows to > > immediately access instantiated objects without wrapping the expression > > into

[PHP-DEV] [RFC] [Discussion] new MyClass()->method() without parentheses

2024-04-07 Thread Valentin Udaltsov
Hello internals, I would like to propose a syntax change for PHP 8.4 that allows to immediately access instantiated objects without wrapping the expression into parentheses. This was requested and discussed several times, see: - https://externals.io/message/66197 - https://bugs.php.net/bug.ph

[PHP-DEV] RFC karma request

2023-12-28 Thread Valentin Udaltsov
Hi internals, I kindly request RFC Karma for my wiki account vudaltsov. I am planning to publish RFC "new MyClass()->method() without parentheses". I already created a PR, where I got generally positive feedback on this feature: https://github.com/php/php-src/pull/13029 Regards, Valentin