1--TEST-- 2testing fsockopen without a protocol string 3--FILE-- 4<?php 5 6echo "Open a server socket\n"; 7$server = stream_socket_server('tcp://127.0.0.1:31337'); 8 9echo "\nCalling fsockopen() without a protocol in the hostname string:\n"; 10$hostname = '127.0.0.1'; 11$port = '31337'; 12$client = fsockopen($hostname, $port); 13var_dump($client); 14fclose($client); 15 16echo "\nCalling fsockopen() with address and port in same string, without a protocol:\n"; 17$address = $hostname . ':' . $port; 18$second_client = fsockopen($address); 19var_dump($second_client); 20fclose($second_client); 21 22echo "Done"; 23?> 24--EXPECTF-- 25Open a server socket 26 27Calling fsockopen() without a protocol in the hostname string: 28resource(%d) of type (stream) 29 30Calling fsockopen() with address and port in same string, without a protocol: 31resource(%d) of type (stream) 32Done 33