Skip to content

Reference arguments appear to not be properly typed (for the purpose of encapsed strings). #13605

@msbit

Description

@msbit

Bug report

Specifically with stream_socket_server which under both failure and success populates the relevant arguments. The functionMap entry appears correct (to my eyes). Creating the variables beforehand and explicitly typing them, culminating in:

/** @var int */
$errorCode = 0;
/** @var string */
$errorMessage = '';

before the call to stream_socket_server, does not fix the issue.

Code snippet that reproduces the problem

https://phpstan.org/r/d2e08603-60e2-4a92-ba94-1acbc44a6329

Expected output

No errors for this case.

Did PHPStan help you today? Did it make you happy in any way?

Always impressed with the breadth of analysis, particularly the narrowing which can make the code very expressive and still type-safe!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions