Re: [PHP-DEV] Revisiting Userland Operator Overloads

2021-08-10 Thread Jordan LeDoux
On Tue, Aug 10, 2021 at 12:15 AM Mike Schinkel wrote: > > So that gives me two (2) thoughts > > 1.) First is Geometry would be another area for PHP to consider adding > classes. > > 2.) Then I thought: What if PHP had the ability to explicitly define > *value* objects? I know this has been

Re: [PHP-DEV] Revisiting Userland Operator Overloads

2021-08-10 Thread Mike Schinkel
> On Aug 9, 2021, at 8:40 PM, Jordan LeDoux wrote: > That is in part of why I asked for use-case examples, to see if there really > were a lot of use-cases where operator overloading makes sense. You only > provided two categories; Math and the already existing DateInterval. > > This

[PHP-DEV] 8.1 / Exception / Property Type / Backwards compatbility

2021-08-10 Thread Philip Hofstetter
Hello The following valid <= PHP 8.0 code that intends to make the $line property public is a fatal error in 8.1 class FooException extends Exception { public $line; } However, the fixed code for 8.1: class FooException extends Exception { public int $line; } Is a fatal error in <=

Re: [PHP-DEV] Revisiting Userland Operator Overloads

2021-08-10 Thread Larry Garfield
On Tue, Aug 10, 2021, at 1:51 AM, Mike Schinkel wrote: > 2.) Then I thought: What if PHP had the ability to explicitly define > *value* objects? I know this has been something Larry Garfield has > mentioned[1] in the past. > > What if we had a new type of class that is to be used only for

Re: [PHP-DEV] Re: [RFC] Nullable intersection types

2021-08-10 Thread Rowan Tommins
On 10/08/2021 13:39, Nicolas Grekas wrote: I will wait if I don't have the choice, but as many others reported, the experience with 7.0 missing nullability was a pain. Apologies if you already did and I've forgotten, but could you please expand on what "pain" you are referring to here?

Re: [PHP-DEV] Re: [RFC] Nullable intersection types

2021-08-10 Thread Nicolas Grekas
> On Wed, 28 Jul 2021 at 08:29, Nicolas Grekas > wrote: > > Nullability is a special beast in PHP. We have a range of operators > > dedicated to it. That's also why I think it deserves special care, and > why > > I think it's important to have this discussion before 8.1 is out. > > Why does this

Re: [PHP-DEV] Revisiting Userland Operator Overloads

2021-08-10 Thread Jordan LeDoux
On Tue, Aug 10, 2021 at 8:46 PM Mike Schinkel wrote: > > Either way if PHP can identify a value object then it could limit operator > overloads to just classes that are value objects by whatever approach PHP > chooses to distinguish. > > > -Mike > [*] Ironically I mentioned you because I thought

Re: [PHP-DEV] Revisiting Userland Operator Overloads

2021-08-10 Thread Mike Schinkel
> On Aug 10, 2021, at 10:22 AM, Larry Garfield wrote: > > Point of order: I do not support a dedicated value-object/data-object > construct, and have said so explicitly. I support targeted tools that make > using objects in that fashion cleaner and more robust. (readonly, asymmetric >