Re: Re: Only variables can be passed by reference

From: Date: Thu, 04 Dec 2014 23:34:48 +0000
Subject: Re: Re: Only variables can be passed by reference
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-79434@lists.php.net to get a copy of this message
Hi Levi, On Fri, Dec 5, 2014 at 8:14 AM, Levi Morrison <levim@php.net> wrote: > > Even when there is parameter to pass, user has to create variable always. > > > > select_select([$a], [$b], [$c], 10); > > > > fails with E_ERROR, while > > > > $x = [$a]; > > $y = [$b]; > > $z = [$c]; > > stream_select($x, $y, $z, 10); > > > > works, but It does not look nice. > > From the documentation: "Also do not forget that those arrays are > passed by reference and will be modified after stream_select() > returns." > > These modify by reference; ignoring this is almost *certainly* a bug > on your part. I'm not discussing about how to use stream_select(), but it's signature and parameter passing behavior. It was wrong example apparently. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net

« previous php.internals (#79434) next »