Closed vicary closed 6 years ago
There is $error ?: error_get_last()['message']
so empty string doesn't matter.
I tried it and it did not confirm what you wrote, i.e. "with error suppression, i.e. @stream_socket_client(), will have $errno set to 0 and $error being an empty string". According my test error suppression has not this effect.
Because this change does have the actual error context throwing.
My experience shows they are in fact empty string and zero, do you think it is caused by some other bugs?
EDIT: Took one more look and found that composer does not have this release yet, but yet, with the suggested line of code it looks like $errno
being zero when suppressed is not handled this way.
I created tag v2.4.5
Thanks. But allow me, is the $errno
being left alone intentionally?
$errno
is passed to SmtpException as second parameter. Or what do you mean?
Because the @
sign will make stream_socket_client()
always leave $errno
as 0
, the new error_get_last()
does not reveal the original error code.
I tried it and it did not confirm what you wrote, i.e. "with error suppression, i.e. @stream_socket_client(), will have $errno set to 0 and $error being an empty string". According my test error suppression has not this effect.
With error suppression, i.e.
@stream_socket_client()
, will have$errno
set to0
and$error
being an empty string''
. This is an undocumented behaviour but leads to inconveniences during debug and development.According to the document and my tests with PHP 7.0, 7.1 and 7.2 this function does not throw.
Removing the
@
sign will have the function populates the actual$errno
and$error
which I believe is in fact the expected result.