-
Notifications
You must be signed in to change notification settings - Fork 651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
False positive when passing null to socket_select #6318
Comments
I found these snippets: https://psalm.dev/r/28b3494123<?php
$null = null;
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
$clients = array($socket);
socket_select($clients, $null, $null, $null, 0);
|
I can't execute it on 3v4l.org. Do you mind checking on your php install that socket_select with a If it doesn't, great! Functions are declared in those files: https://github.com/vimeo/psalm/tree/master/dictionaries you should be able to update them accordingly |
Thanks, it was indeed a bug within the dictionary. I created a pull request with the fix. |
results in
ERROR: NullArgument - 6:39 - Argument 4 of socket_select cannot be null, null value provided to parameter with type int
However the expected input is
?int
and a null variable can be passed.https://www.php.net/manual/en/function.socket-select.php
https://psalm.dev/r/28b3494123
The text was updated successfully, but these errors were encountered: