Re: [RFC] switch expression
| From: | G. P. B. | Date: | Sun, 29 Mar 2020 21:47:42 +0000 |
| Subject: | Re: [RFC] switch expression | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-109431@lists.php.net to get a copy of this message | ||
On Sun, 29 Mar 2020 at 23:04, Ilija Tovilo <tovilo.ilija@gmail.com> wrote:
> > Having two syntaxes for one keyword is not a good idea,
>
> We're already doing that. What about classes vs anonymous objects?
> Functions vs closures?
> They're using the same keywords. There's no confusion.
>
> Ilija
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
No offence but, that argument is dumb.
A closure and a function are the same thing because the Closure class
comes from a need to have consistent functions regardless of scope.
And an anonymous object still behaves like a normal object, you can
extend it, add methods to it, use traits.
On the contrary having two different meaning for a fundamental construct
is just weird, and if that goes to vote I'll vote against it.
Moreover, no need to repeat mistakes other languages have made.
Best regards
George P. Banyard