facebook / facebook/hhvm

Retrieving remote address from listening streams should not throw a warning

Open
#6,937 0 comments 0 reactions 0 assignees View on GitHub
framework parity php5 incompatibility php7 incompatibility probably easy
Dominant language
C++
Stars
18.7k
Forks
3.1k
Avg merge
1h 47m
Merged PRs (30d)
2

Description

### Explanation

In order to verify if given stream resource is an listening socket or accepted connection `stream_socket_get_name($stream, true)` could be used. This behavior is defined by [Zend Engine testcase](https://github.com/php/php-src/blob/master/ext/standard/tests/streams/stream_socket_get_name.phpt).

All HHVM versions despite returning `false` for such call also display warning which, in my opinion, should happened - it forces devs to use silence operator in unit tests.
### HHVM Version

3.6.1 - 3.12.1
### Standalone code, or other way to reproduce the problem

`stream_socket_get_name($streamSocketServer, true)`
Runnable code: https://3v4l.org/jQBGr
### Expected result

`bool(false)`
### Actual result

```
Warning: unable to retrieve peer name [107]: Transport endpoint is not connected in [...] on line [...]

bool(false)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.