Re: Re: Only variables can be passed by reference
| From: | Eugene | Date: | Fri, 05 Dec 2014 09:18:36 +0000 |
| Subject: | Re: Re: Only variables can be passed by reference | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-79440@lists.php.net to get a copy of this message | ||
Hi Yasuo,
On Thu, Dec 4, 2014 at 11:38 AM, Yasuo Ohgaki <yohgaki@ohgaki.net> wrote:
> Hi all,
>
> Sorry for multiple posts. This would be the last one.
>
> On Thu, Dec 4, 2014 at 7:08 PM, Yasuo Ohgaki <yohgaki@ohgaki.net> wrote:
>
> > On Thu, Dec 4, 2014 at 5:28 PM, Yasuo Ohgaki <yohgaki@ohgaki.net> wrote:
> >
> >> I think we can get rid of this error now when literal is returned.
> >> The reason we have E_STRICT error is that legacy PHP didn't
> >> support this, I suppose.
> >>
> >> http://3v4l.org/8fISj
> >>
> >> Is it possible to allow literal as referenced parameter for PHP7?
> >> It's better to remove needless restrictions where it is possible.
> >> HHVM seems already support this.
> >>
> >> http://3v4l.org/t79rF
> >>
> >> Any comments?
> >>
> >
> > I made a little better sample code.
> >
> > http://3v4l.org/d51DQ
> >
> > I would like to hear opinions from engine experts.
>
>
> Yet another sample code. This cannot be executed on 3v4l.org for security
> reasons.
>
> <?php
> $sock = fsockopen('www.php.net', '80');
> var_dump($sock);
>
> $socks = array($sock);
> var_dump(stream_select($socks, $socks, $socks, 1));
>
> //var_dump(stream_select(array($sock), array($sock), array($sock), 1));
> //Fatal error: Only variables can be passed by reference in
> /home/yohgaki/tmp/ttt.php on line 8
> ?>
>
> Regards,
>
> --
> Yasuo Ohgaki
> yohgaki@ohgaki.net
>
Here is a real use case where removing this error would be beneficial:
https://github.com/mongofill/mongofill/issues/23#issuecomment-36469658
--
Thank you and best regards,
Eugene Leonovich