3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = 'http://stof.notk.org/'; $context = stream_context_create(array( 'http' => array('timeout' => 60) )); $fp = @fopen($url, 'r', false); if (false === $fp) { throw new Exception("Unable to connect ! "); } stream_set_blocking($fp, 1); stream_set_timeout($fp, 60); stream_socket_shutdown($fp, STREAM_SHUT_WR); $result = stream_get_contents($fp); fclose($fp); var_dump($result);

preferences:
37.24 ms | 402 KiB | 5 Q