The detach() method of StreamInterface in PSR-7 isn't mentioned anywhere in 
the documentation or meta.

The only documentation for it, is the inline documentation, which doesn't 
explain what it's for:

> Separates any underlying resources from the stream.

So basically, this sets the internal resource handle (an implementation 
detail!) to null, right?

> After the stream has been detached, the stream is in an unusable state.

So if I want my stream object in an invalid, unusable state, this is the 
method to call.

Huh?

When would I want that?

Since streams are (primarily) intended as wrappers around PHP 
stream-resource handles, I would have expected that the way to "detach" a 
StreamInterface instance from the native stream-resource handle, is to 
destroy the object - since a StreamInterface-wrapper around a PHP 
stream-resource handle really represents only one thing: the 
resource-handle.

When would "detaching" and leaving the object in an invalid state make more 
sense than simply destroying the object, and thereby the reference to the 
stream-resource handle?

-- 
You received this message because you are subscribed to the Google Groups "PHP 
Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/php-fig/99fd9037-331d-4645-ad0f-c911ae370356%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to