Re: Re: [RFC] Union Types v2
| From: | Dan Ackroyd | Date: | Fri, 25 Oct 2019 15:40:36 +0000 |
| Subject: | Re: Re: [RFC] Union Types v2 | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-107700@lists.php.net to get a copy of this message | ||
On Fri, 25 Oct 2019 at 14:27, Dmitry Stogov <dmitry@zend.com> wrote:
>
> // <= 100 type checks on a single assignment
That code contains a reference that is re-used 100 times.
I personally prefer not to use references at all, but if people do
want to use them, we could put a note that references are bad for
performance when used with types. People can then choose between:
* using types, and not references for good performance.
* using references, and not types for good performance.
* using references and types, and getting slightly less good performance.
> I don't like to complicate the language with features
> that shouldn't be often used,
Can we start the discussion about deprecating references in PHP 8 then?
Very few people are writing code using them currently, and they seem
to cause quite a lot of confusion, judging by the bug reports about
them. If you're also saying that they are making it difficult to write
performant PHP, that seems to be a good argument for looking at what
would be needed to be done to remove them.
cheers
Dan
Ack