Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Only variables should be passed by reference - socket_select()

Tags:

php

sockets

I have a function in my class which utilizes the socket_select() function and I noticed that it's throwing this warning:

Strict Standards: *Only variables should be passed by reference*

This is how I'm using it, and yes, I did read the "Example #1 Using NULL with socket_select()" in the PHP Manual

$read = array($this->socket);
$write = NULL;
$except = NULL;

socket_select($read, $write, $except, 0, $this->socket_timeout);

This results in a big error spam when calling the function inside a while loop. Of course, I can suppress the E_STRICT errors, but I would like to know what's the exact issue here. My PHP version is 5.3.5

like image 891
spidEY Avatar asked Jul 30 '11 12:07

spidEY


1 Answers

Possibly it doesn't like a NULL reference?

I would try:

$read = array($this->socket);
$write = array();
$except = array();
like image 156
BadPenguin Avatar answered Oct 07 '22 08:10

BadPenguin