Re: [PHP-DEV] [Pre-RFC Discussion] User Defined Operator Overloads (again)

2024-09-16 Thread Jordan LeDoux
On Mon, Sep 16, 2024 at 9:35 PM Mike Schinkel wrote: > > Yes, if constraints of the nature I propose below are adopted. > > The biggest problem I have with operator overloads is that — once added — > all code could potentially be "infected" with operator overloads. However, > if the developer *us

Re: [PHP-DEV] Re: Which IDE do you recommend for php-src development?

2024-09-16 Thread Larry Garfield
On Mon, Sep 16, 2024, at 7:06 PM, Hans Henrik Bergan wrote: > +1 for VSCode, I use it practically everywhere these days, > HTML/Javascript/TypeScript/PHP/C/C++/Python/Lua, all on VSCode. > > On Mon, 16 Sept 2024 at 13:07, Barel wrote: >> >> On Sat, 14 Sept 2024 at 23:44, Barel wrote: >>> >>> Hi >

Re: [PHP-DEV] [Pre-RFC Discussion] User Defined Operator Overloads (again)

2024-09-16 Thread Larry Garfield
On Mon, Sep 16, 2024, at 2:47 AM, Jordan LeDoux wrote: > On Sun, Sep 15, 2024 at 9:12 PM Larry Garfield wrote: >> >> The "multiply by -1 for <=>" bit I don't fully understand the point of. The >> RFC tries to explain, but I don't quite grok it. >> > > I will perhaps respond with more detail to

Re: [PHP-DEV] [Pre-RFC Discussion] User Defined Operator Overloads (again)

2024-09-16 Thread Mike Schinkel
> On Sep 14, 2024, at 5:48 PM, Jordan LeDoux wrote: > > Hello internals, > > This discussion will use my previous RFC as the starting point for > conversation: https://wiki.php.net/rfc/user_defined_operator_overloads > > There has been discussion on list recently about revisiting the topic o

Re: [PHP-DEV] Re: Which IDE do you recommend for php-src development?

2024-09-16 Thread Hans Henrik Bergan
+1 for VSCode, I use it practically everywhere these days, HTML/Javascript/TypeScript/PHP/C/C++/Python/Lua, all on VSCode. On Mon, 16 Sept 2024 at 13:07, Barel wrote: > > On Sat, 14 Sept 2024 at 23:44, Barel wrote: >> >> Hi >> >> For C/C++ development I usually use CLion from Jetbrains but I tri

Re: [PHP-DEV] [RFC] Change Directory class to behave like an opaque object

2024-09-16 Thread Christoph M. Becker
On 16.09.2024 at 18:31, Derick Rethans wrote: > On Sat, 14 Sep 2024, Gina P. Banyard wrote: > >> I came across the Directory class while doing some code exploration of >> ext/standard. This class is effectively an opaque object for Directory >> resources, however it doesn't behave like one, as it

[PHP-DEV] Adding new `ReflectionConstant::getFileName()`

2024-09-16 Thread Daniel Scherzer
Dear Internals, Last week I sent a patch[1] to address a feature request[2] for a way to identify at runtime what file a constant was declared in. Since this adds the filename (a `zend_string`) to every `zend_constant` instance, it is not the most trivial of changes. It was suggested[3] by iluuu1

Re: [PHP-DEV] [Pre-RFC Discussion] User Defined Operator Overloads (again)

2024-09-16 Thread Jordan LeDoux
On Mon, Sep 16, 2024 at 6:08 AM Rob Landers wrote: > On Mon, Sep 16, 2024, at 09:47, Jordan LeDoux wrote: > > The reason for this was to prevent developers from creating situations > where `5 > $foo` is true and `5 < $foo` is true. > > > Just to point out: currently, PHP already does nonsensical

Re: [PHP-DEV] [Pre-RFC Discussion] User Defined Operator Overloads (again)

2024-09-16 Thread Jordan LeDoux
On Mon, Sep 16, 2024 at 6:52 AM Bilge wrote: > > > On Mon, 16 Sept 2024, 15:28 someniatko, wrote: > >> On behalf of all struggling PHP developers who would like to implement >> patterns like Value Objects, with custom equality criterias >> > > I seriously doubt anyone is struggling without this,

Re: [PHP-DEV] [Pre-RFC Discussion] User Defined Operator Overloads (again)

2024-09-16 Thread Derick Rethans
On Sat, 14 Sep 2024, Jordan LeDoux wrote: > I want to discuss what changes to the previous proposal people would > be seeking, and why. The most contentious design choice of the > previous proposal was undoubtedly the `operator` keyword and the > decision to make operator overload implementatio

Re: [PHP-DEV] [RFC] Change Directory class to behave like an opaque object

2024-09-16 Thread Derick Rethans
On Sat, 14 Sep 2024, Gina P. Banyard wrote: > I came across the Directory class while doing some code exploration of > ext/standard. This class is effectively an opaque object for Directory > resources, however it doesn't behave like one, as it has existed since > PHP 4. > > As such, I am prop

Re: [PHP-DEV] [Pre-RFC Discussion] User Defined Operator Overloads (again)

2024-09-16 Thread Bilge
On Mon, 16 Sept 2024, 15:28 someniatko, wrote: > On behalf of all struggling PHP developers who would like to implement > patterns like Value Objects, with custom equality criterias > I seriously doubt anyone is struggling without this, unless you care to provide proof to the contrary. I think t

Re: [PHP-DEV] [Pre-RFC Discussion] User Defined Operator Overloads (again)

2024-09-16 Thread someniatko
> This discussion will use my previous RFC as the starting point for > conversation: https://wiki.php.net/rfc/user_defined_operator_overloads > There has been discussion on list recently about revisiting the topic of > operator overloads after the previous effort which I proposed was declined.

Re: [PHP-DEV] [Pre-RFC Discussion] User Defined Operator Overloads (again)

2024-09-16 Thread Rob Landers
On Mon, Sep 16, 2024, at 09:47, Jordan LeDoux wrote: > The reason for this was to prevent developers from creating situations where > `5 > $foo` is true and `5 < $foo` is true. Just to point out: currently, PHP already does nonsensical comparisons: https://3v4l.org/BZfc8 Granted, it is 'techni

Re: [PHP-DEV] [Pre-RFC Discussion] User Defined Operator Overloads (again)

2024-09-16 Thread Alexandru Pătrănescu
On Sun, Sep 15, 2024 at 12:52 AM Jordan LeDoux wrote: > > These changes could and should be provided independent of operator > overloads. Gina has been working on a separate RFC which would cover all > three of these issues. You can view the work-in-progress on that RFC here: > https://github.com

[PHP-DEV] Re: Which IDE do you recommend for php-src development?

2024-09-16 Thread Barel
On Sat, 14 Sept 2024 at 23:44, Barel wrote: > Hi > > For C/C++ development I usually use CLion from Jetbrains but I tried to > use it with php-src and was unable to get it to work properly. CLion really > insists on using CMake and has only quite limited support for makefiles. > After trying to g

Re: [PHP-DEV] [Pre-RFC Discussion] User Defined Operator Overloads (again)

2024-09-16 Thread Jordan LeDoux
On Sun, Sep 15, 2024 at 9:12 PM Larry Garfield wrote: > > The "multiply by -1 for <=>" bit I don't fully understand the point of. > The RFC tries to explain, but I don't quite grok it. > > I will perhaps respond with more detail to the rest of your message later, but I wanted to address this spec