Skip to content

Commit 40be5fa

Browse files
committed
ext/sockets: Remove bool type coercions in tests
1 parent 4ff8d9f commit 40be5fa

6 files changed

+7
-8
lines changed

ext/sockets/tests/socket_export_stream-1.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sockets
55
--FILE--
66
<?php
77

8-
$domain = (strtoupper(substr(PHP_OS, 0, 3) == 'WIN') ? AF_INET : AF_UNIX);
8+
$domain = PHP_OS_FAMILY == 'Windows' ? AF_INET : AF_UNIX;
99
socket_create_pair($domain, SOCK_STREAM, 0, $s);
1010

1111
$s0 = reset($s);

ext/sockets/tests/socket_export_stream-3.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ $br = socket_bind($sendsock, '127.0.0.1');
3434
$so = socket_sendto($sendsock, $m = "my message", strlen($m), 0, "224.0.0.23", $port);
3535
var_dump($so);
3636

37-
stream_set_blocking($stream, 0);
37+
stream_set_blocking($stream, false);
3838
var_dump(fread($stream, strlen($m)));
3939
echo "Done.\n";
4040
?>

ext/sockets/tests/socket_export_stream-4.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function test($stream, $sock) {
1616
if ($stream !== null) {
1717
echo "stream_set_blocking ";
1818
try {
19-
print_r(stream_set_blocking($stream, 0));
19+
print_r(stream_set_blocking($stream, false));
2020
} catch (Error $e) {
2121
echo get_class($e), ": ", $e->getMessage(), "\n";
2222
}

ext/sockets/tests/socket_import_stream-1.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sockets
55
--FILE--
66
<?php
77

8-
$domain = (strtoupper(substr(PHP_OS, 0, 3) == 'WIN') ? STREAM_PF_INET : STREAM_PF_UNIX);
8+
$domain = PHP_OS_FAMILY == 'Windows' ? STREAM_PF_INET : STREAM_PF_UNIX;
99
$s = stream_socket_pair($domain, STREAM_SOCK_STREAM, 0);
1010

1111
$s0 = reset($s);

ext/sockets/tests/socket_import_stream-3.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ $br = socket_bind($sendsock, '127.0.0.1');
3434
$so = socket_sendto($sendsock, $m = "my message", strlen($m), 0, "224.0.0.23", 58379);
3535
var_dump($so);
3636

37-
stream_set_blocking($stream, 0);
37+
stream_set_blocking($stream, false);
3838
var_dump(fread($stream, strlen($m)));
3939
echo "Done.\n";
4040
?>

ext/sockets/tests/socket_import_stream-4.phpt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ socket_import_stream: effects of closing
44
sockets
55
--SKIPIF--
66
<?php
7-
8-
if(substr(PHP_OS, 0, 3) == 'WIN' ) {
7+
if (PHP_OS_FAMILY === 'Windows') {
98
die("skip Not Valid for Windows");
109
}
1110
?>
@@ -16,7 +15,7 @@ function test($stream, $sock) {
1615
if ($stream !== null) {
1716
echo "stream_set_blocking ";
1817
try {
19-
print_r(stream_set_blocking($stream, 0));
18+
print_r(stream_set_blocking($stream, false));
2019
} catch (Error $e) {
2120
echo get_class($e), ": ", $e->getMessage(), "\n";
2221
}

0 commit comments

Comments
 (0)