On Mon, 4 May 2020 at 10:54, Manuel Canga <p...@manuelcanga.dev> wrote:
> Hi internals, > I would like to present a possible new RFC( "keep type of reference > params" ) for your > consideration. > [...] > The result of this code is a warning( in count line ) because of $array is > a string. > > However, I think it should be an error or exception when a string is > assigned to $array var. > > In my opinion, $array var would have to keep its type when function ends. > > What is your opinion ? Do you see it useful ? I think everyone can agree this is useful. But the issue here is the implementation. Because from what I know PHP's references are a special kind of pain in the engine. That's why the common wisdom is to use references in PHP as least as possible. And IIRC what you are trying to achieve would need a major overhaul of how references work and someone who wanted to tackle this would have done it on their own and propose an RFC at the same time. So sadly unless something semi-concrete shows up, I'm considering this a pipe dream. But I'd gladly be shown otherwise. Best regards George P. Banyard