If the following line of code causes php to consume 100% of the cpu time
while(true){}
then why should the following code not do the same? after all, !feof($fp)
is just a boolean expression, and when evaluating as true, it uses no perceivable cpu time at all.
$fp = stream_socket_client($remote_socket);
while(!feof($fp)){}