You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows: _get_osfhandle asserts in debug mode when given a socket #19722
When calling stream_select() with a stream socket, this will assert in debug binaries, which makes it inconvenient to test some applications.
I'm not sure what could be done to address this. There doesn't seem to be an easy way to ask the CRT if the fd is a file resource.
According to ChatGPT getsockopt() and checking for WSAENOTSOCK might be a better way to check for sockets, but I haven't tried this myself.
Hoping someone with more expertise about the depths of Windows can suggest something.
Activity
devnexen commentedon Sep 5, 2025
Hi @dktapps sorry to hijack your ticket, seems you seem to know well windows, if I m not asking too much, would you mind having a look there ? Cheers.
Proposed fix for php#19722
Fix phpGH-19722: Windows: _get_osfhandle asserts in debug mode when g…
Fix GH-19722: Windows: _get_osfhandle asserts in debug mode when give…
Merge branch 'PHP-8.3' into PHP-8.4
Merge branch 'PHP-8.4' into PHP-8.5
Merge branch 'PHP-8.5'