1--TEST--
2GH-11418: fgets on a redis socket connection fails on PHP 8.3
3--FILE--
4<?php
5
6$serverCode = <<<'CODE'
7$server = stream_socket_server('tcp://127.0.0.1:64325');
8phpt_notify();
9
10$conn = stream_socket_accept($server);
11
12fwrite($conn, "Hi Hello"); // 8 bytes
13usleep(50000);
14fwrite($conn, " World\n"); // 8 bytes
15
16fclose($conn);
17fclose($server);
18CODE;
19
20$clientCode = <<<'CODE'
21
22phpt_wait();
23
24$fp = fsockopen("tcp://127.0.0.1:64325");
25
26echo fread($fp, 3);
27echo fgets($fp);
28
29CODE;
30
31include sprintf("%s/../../../openssl/tests/ServerClientTestCase.inc", __DIR__);
32ServerClientTestCase::getInstance()->run($clientCode, $serverCode);
33
34?>
35--EXPECT--
36Hi Hello World
37