Fix php_pgsql_fd_cast() wrt. php_stream_can_cast() #6888
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
php_stream_can_cast()
forwards to_php_stream_cast()
withret
setto
NULL
.php_pgsql_fd_cast()
needs to cater to that, becauseotherwise the stream would report that it is not castable.
This might fix https://bugs.php.net/73903.
It seems not possible to write a meaningful regression test for this behavior, since the core and bundled extensions only use
php_stream_can_cast()
when checking for a TTY. It would, of course, be possible to use ext/zend_test, but that might be overkill.