On Thu, 25 Jul 2019 at 16:18, Nikita Popov <nikita....@gmail.com> wrote:

>> That would stop people having to write `$matches = []; preg_match($foo,
$bar, $matches);`

> Eww, please don't write code like that...

Huh? How would you write it then?


The behavior of type annotations should also change, "out T $x" should
> check that the value assigned to $x on function exist (or possibly on every
> write to the variable?) is T. "inout T $x" should check that $x is T on
> entry, and also on exit (or on every assignment).
>


Ah, you're right, I hadn't thought about the implications for type checks.

Still, I'd rather wait for an actual new feature like this than dig into my
repo and revert the PHP 5.4 update commit so that all the call-site
ampersands are back, but still with all the drawbacks of references.
Contrary to the RFC, I have never thought of this as "PHP 4 behaviour",
because I used it right up until 5.3, exactly how this RFC is now
suggesting is the future. (I guess I should have paid more attention to
deprecation notices at the time!)

Regards,
-- 
Rowan Collins
[IMSoP]

Reply via email to