Re: Re: Only variables can be passed by reference
| From: | Andrea Faulds | Date: | Thu, 04 Dec 2014 12:26:06 +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-79424@lists.php.net to get a copy of this message | ||
> On 4 Dec 2014, at 10:38, Yasuo Ohgaki <yohgaki@ohgaki.net> wrote:
>
>
> 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
> ?>
Using stream_select without real variables like that is weird, what’s the point? You’ve
discarded the read/write/error information, all the return value tells you is that *something*
changed.
--
Andrea Faulds
http://ajf.me/