ext/sockets: Remove bool type coercions in tests

This commit is contained in:
Gina Peter Banyard 2025-06-23 14:43:53 +02:00
parent 4ff8d9f6b4
commit 40be5fa99f
6 changed files with 7 additions and 8 deletions

View file

@ -5,7 +5,7 @@ sockets
--FILE--
<?php
$domain = (strtoupper(substr(PHP_OS, 0, 3) == 'WIN') ? AF_INET : AF_UNIX);
$domain = PHP_OS_FAMILY == 'Windows' ? AF_INET : AF_UNIX;
socket_create_pair($domain, SOCK_STREAM, 0, $s);
$s0 = reset($s);

View file

@ -34,7 +34,7 @@ $br = socket_bind($sendsock, '127.0.0.1');
$so = socket_sendto($sendsock, $m = "my message", strlen($m), 0, "224.0.0.23", $port);
var_dump($so);
stream_set_blocking($stream, 0);
stream_set_blocking($stream, false);
var_dump(fread($stream, strlen($m)));
echo "Done.\n";
?>

View file

@ -16,7 +16,7 @@ function test($stream, $sock) {
if ($stream !== null) {
echo "stream_set_blocking ";
try {
print_r(stream_set_blocking($stream, 0));
print_r(stream_set_blocking($stream, false));
} catch (Error $e) {
echo get_class($e), ": ", $e->getMessage(), "\n";
}

View file

@ -5,7 +5,7 @@ sockets
--FILE--
<?php
$domain = (strtoupper(substr(PHP_OS, 0, 3) == 'WIN') ? STREAM_PF_INET : STREAM_PF_UNIX);
$domain = PHP_OS_FAMILY == 'Windows' ? STREAM_PF_INET : STREAM_PF_UNIX;
$s = stream_socket_pair($domain, STREAM_SOCK_STREAM, 0);
$s0 = reset($s);

View file

@ -34,7 +34,7 @@ $br = socket_bind($sendsock, '127.0.0.1');
$so = socket_sendto($sendsock, $m = "my message", strlen($m), 0, "224.0.0.23", 58379);
var_dump($so);
stream_set_blocking($stream, 0);
stream_set_blocking($stream, false);
var_dump(fread($stream, strlen($m)));
echo "Done.\n";
?>

View file

@ -4,8 +4,7 @@ socket_import_stream: effects of closing
sockets
--SKIPIF--
<?php
if(substr(PHP_OS, 0, 3) == 'WIN' ) {
if (PHP_OS_FAMILY === 'Windows') {
die("skip Not Valid for Windows");
}
?>
@ -16,7 +15,7 @@ function test($stream, $sock) {
if ($stream !== null) {
echo "stream_set_blocking ";
try {
print_r(stream_set_blocking($stream, 0));
print_r(stream_set_blocking($stream, false));
} catch (Error $e) {
echo get_class($e), ": ", $e->getMessage(), "\n";
}