Re: [RFC] Enumerations, Round 2

From: Date: Tue, 29 Dec 2020 02:37:18 +0000
Subject: Re: [RFC] Enumerations, Round 2
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-112629@lists.php.net to get a copy of this message
On Mon, Dec 28, 2020, at 6:40 PM, Benjamin Morel wrote:
> Hi Larry, thank you for the updated RFC!
> I love it, and having played with the implementation, I can say I love it
> so far as well.
> 
> I have one suggestion regarding reflection:
> Shouldn't ReflectionCase expose an additional getInstance() method, that
> would return the case instance, such as Suit::HEARTS?

I... thought we had that in there.  Did I remove the wrong method?  I know it's in there
somewhere.  Let me double check with Ilija on what it's supposed to be called.  Will update
when that's sorted out.

> Also, I noticed 2 typos in the code samples:
> 
> - in "Enumerated Methods", 1st code block: missing "implements Colorful"
> after "enum Suit"
> - in "Enumerated Methods", 2nd code block: missing "public function
> color()" after "private function __construct() {}"

Both fixed, thanks.

> Finally, I got a segmentation fault while trying to use what I think is an
> unsupported syntax (removing the ":string" from a scalar enum), where is
> the correct place to report this? The GitHub PR?

On the PR, please.  Sounds like we need a few more negative tests to make sure it fails gracefully.

--Larry Garfield


Thread (52 messages)

« previous php.internals (#112629) next »