<?php
                     
$socket = socket_create(AF_INET, SOCK_STREAM, 0) or die('Failed to create socket!');
                  
socket_bind($socket, 0,                                        8080);
socket_listen($socket);

$msg = '<html><head><title>Goodbye, world!</title></head><body>Goodbye, world!</body></html>';

for (;;) {
    
    if ($client = @socket_accept($socket)) {
        socket_write($client,  .
                . strlen($msg) .  .
                .
               $msg);
    }
    else usleep(100000); 
}
?>