Re: [Early Feedback] Pattern matching

From: Date: Thu, 27 Jun 2024 16:42:13 +0000
Subject: Re: [Early Feedback] Pattern matching
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
> $p is Point {x: 3, y: $y};
> // If $p->x === 3, bind $p->y to $y and return true.

> $p is Point {y: 37, x:@($x)};
> // $p->x === $x && $p->y == 37

I'm just going to put in my $0.02 here and downvote this syntax. I
believe that it should be swapped. IMO, {x: 3, y: $y} looks too
similar to the named arguments syntax.


Thread (79 messages)

« previous php.internals (#123942) next »