mkoppanen/php-zmq — pull request #96 by alethia7 (2013-09-14 05:41:37+00:00)
Title: Allow socket streams to be polled

ZMQPoll::add() throws a ZMQPollException for php socket stream resources created with fsockopen() and stream_socket_client(). The ZMQPollException is "Failed to cast the supplied stream resource." This points to line 191 in [https://github.com/mkoppanen/php-zmq/blob/master/zmq_pollset.c]. Adding PHP_STREAM_AS_SOCKETD as a cast type resolves this error.

Is there a reason why PHP_STREAM_AS_SOCKETD was not originally included here? Would this be a good fix?