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
zend-diactoros && nyholm/psr7
They try to rewind a pipe according to standart, but ignore seek operation and return content, because a pipe is non-seekable. guzzlehttp/psr7 && slim/psr7
They try to rewind a stream then as result get RuntimeException and return the empty string.
In my opinion, it will be more logical to use the first strategy. What do you thing about it?
The text was updated successfully, but these errors were encountered:
mapogolions
changed the title
Cast to string non-seekable resources
Cast to string a non-seekable resources
Aug 13, 2019
I looked at the source code of various
Stream
class implementations. In particular, the__toString
method.I noticed inconsistent behavior when working with non-seekable resources. For instance, a simple pipe -
popen('echo 12', 'r')
.zend-diactoros
&&nyholm/psr7
They try to rewind a pipe according to standart, but ignore
seek
operation and return content, because a pipe is non-seekable.guzzlehttp/psr7
&&slim/psr7
They try to rewind a stream then as result get RuntimeException and return the empty string.
In my opinion, it will be more logical to use the first strategy. What do you thing about it?
The text was updated successfully, but these errors were encountered: