1--TEST-- 2stream context tcp_nodelay 3--SKIPIF-- 4<?php 5if (getenv("SKIP_ONLINE_TESTS")) die("skip online test"); 6if (!extension_loaded("sockets")) die("skip: need sockets"); 7 ?> 8--FILE-- 9<?php 10$ctxt = stream_context_create([ 11 "socket" => [ 12 "tcp_nodelay" => true 13 ] 14]); 15 16$stream = stream_socket_client( 17 "tcp://www.php.net:80", $errno, $errstr, 10, STREAM_CLIENT_CONNECT, $ctxt); 18 19$socket = 20 socket_import_stream($stream); 21 22var_dump(socket_get_option($socket, SOL_TCP, TCP_NODELAY) > 0); 23?> 24--EXPECT-- 25bool(true) 26