Hi, A feature request about this had been created recently, https://github.com/php/php-src/issues/20532 and I do agree it would be an useful information to get rather just FALSE at the moment.
The actual PR <https://github.com/php/php-src/pull/20534> just return the error code but bukka raised a good point, why not just adding an optional parameter if you wish to know about this, changing towards this direction does not bother me I ll very likely lean towards it. As said however I do not think using socket_last_error() for this would be a good thing <https://github.com/php/php-src/pull/20534#issuecomment-3591802496>. Let me know your thoughts on this. Cheers !
